diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-07-01 18:29:29 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-07-01 18:29:29 +0000 |
commit | 41a82693da93791f3e32dd4b26966a72d4452813 (patch) | |
tree | 2f128286040b003dac81f874518dd244da540b7f | |
parent | 19682fa3d8e13fc94286ca2aa8ac87030bf8eda2 (diff) |
Move mtod() after the m_pullup() --- noted by sam@errno.com (who seems
to be going over the IPsec code with a magnifying glass)
-rw-r--r-- | sys/netinet/ipsec_output.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c index bc6ce4b09a6..d9fcce7c4fb 100644 --- a/sys/netinet/ipsec_output.c +++ b/sys/netinet/ipsec_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_output.c,v 1.23 2002/06/19 22:03:46 angelos Exp $ */ +/* $OpenBSD: ipsec_output.c,v 1.24 2002/07/01 18:29:28 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -256,12 +256,12 @@ ipsp_process_packet(struct mbuf *m, struct tdb *tdb, int af, int tunalready) #ifdef INET if (tdb->tdb_dst.sa.sa_family == AF_INET && setdf) { - ip = mtod(m, struct ip *); if (m->m_len < sizeof(struct ip)) if ((m = m_pullup(m, sizeof(struct ip))) == NULL) return ENOBUFS; + ip = mtod(m, struct ip *); NTOHS(ip->ip_off); ip->ip_off |= IP_DF; HTONS(ip->ip_off); |