diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-06-26 18:17:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-06-26 18:17:55 +0000 |
commit | bdc0f5c45c706103e152c0beab9b55a7480c1af8 (patch) | |
tree | 0ba24243e4b1382beb8fbfd4a191a3d058297df2 /sys/netinet | |
parent | 989450b1bff0f90ab71e253c215cdc79a7f895df (diff) |
no longer pass around **m
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_input.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 30 |
2 files changed, 14 insertions, 26 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index d915dbadec8..c57dba67acc 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.86 2001/06/25 08:05:24 art Exp $ */ +/* $OpenBSD: ip_input.c,v 1.87 2001/06/26 18:17:54 deraadt Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -386,12 +386,8 @@ ipv4_input(m) * Packet filter */ #if NPF > 0 - { - struct mbuf *m1 = m; - if (pf_test(PF_IN, m->m_pkthdr.rcvif, &m1) != PF_PASS) - goto bad; - ip = mtod(m = m1, struct ip *); - } + if (pf_test(PF_IN, m->m_pkthdr.rcvif, m) != PF_PASS) + goto bad; #endif /* * Process options and, if not destined for us, diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index daef0dfeb88..77b3ff88c54 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.126 2001/06/25 17:16:23 angelos Exp $ */ +/* $OpenBSD: ip_output.c,v 1.127 2001/06/26 18:17:54 deraadt Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -589,17 +589,13 @@ sendit: * Packet filter */ #if NPF > 0 - { - struct mbuf *m1 = m; - if (pf_test(PF_OUT, &encif[0].sc_if, &m1) != PF_PASS) { - error = EHOSTUNREACH; - splx(s); - m_freem(m1); - goto done; - } - ip = mtod(m = m1, struct ip *); - hlen = ip->ip_hl << 2; + if (pf_test(PF_OUT, &encif[0].sc_if, m) != PF_PASS) { + error = EHOSTUNREACH; + splx(s); + m_freem(m); + goto done; } + hlen = ip->ip_hl << 2; #endif tdb = gettdb(sspi, &sdst, sproto); @@ -678,14 +674,10 @@ sendit: * Packet filter */ #if NPF > 0 - { - struct mbuf *m1 = m; - if (pf_test(PF_OUT, ifp, &m1) != PF_PASS) { - error = EHOSTUNREACH; - m_freem(m1); - goto done; - } - ip = mtod(m = m1, struct ip *); + if (pf_test(PF_OUT, ifp, m) != PF_PASS) { + error = EHOSTUNREACH; + m_freem(m); + goto done; } #endif /* Catch routing changes wrt. hardware checksumming for TCP or UDP. */ |