From 41a82693da93791f3e32dd4b26966a72d4452813 Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Mon, 1 Jul 2002 18:29:29 +0000 Subject: Move mtod() after the m_pullup() --- noted by sam@errno.com (who seems to be going over the IPsec code with a magnifying glass) --- sys/netinet/ipsec_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') 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); -- cgit v1.2.3