summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-06-11 11:29:36 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-06-11 11:29:36 +0000
commit9f1e83adf5a46e00e53fe55de42cb2e82aafccce (patch)
tree35641306cae03ed5d08deccffc74a330e15f28d9
parent09ba08d9b6eb5c3dd9055172842ad119027a6e86 (diff)
there was code inside #if NPF > 0, but pf.h was not included, so it did
not get build. the code looks at flags that used to be in mbuf tags, now they are in the mbuf header, so we can check them unconditionally. problem spotted by Daniel Roethlisberger <daniel@roe.ch>, ok ryan markus
-rw-r--r--sys/netinet/ip_icmp.c16
-rw-r--r--sys/netinet/tcp_input.c9
-rw-r--r--sys/netinet/udp_usrreq.c9
3 files changed, 9 insertions, 25 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index f0b2a39eaa5..54fa1c8a202 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.75 2007/05/27 19:55:13 dlg Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.76 2007/06/11 11:29:35 henning Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -142,9 +142,6 @@ icmp_do_error(struct mbuf *n, int type, int code, n_long dest, int destmtu)
struct icmp *icp;
struct mbuf *m;
unsigned icmplen, mblen;
-#if NPF > 0
- struct pf_mtag *mtag;
-#endif
#ifdef ICMPPRINTFS
if (icmpprintfs)
@@ -260,14 +257,11 @@ icmp_do_error(struct mbuf *n, int type, int code, n_long dest, int destmtu)
nip->ip_p = IPPROTO_ICMP;
nip->ip_src = oip->ip_src;
nip->ip_dst = oip->ip_dst;
-#if NPF > 0
+
/* move PF_GENERATED to new packet, if existant XXX preserve more? */
- if ((mtag = pf_find_mtag(n)) != NULL &&
- mtag->flags & PF_TAG_GENERATED) {
- mtag = pf_get_tag(m);
- mtag->flags |= PF_TAG_GENERATED;
- }
-#endif
+ if (n->m_pkthdr.pf.flags & PF_TAG_GENERATED)
+ m->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
+
m_freem(n);
return (m);
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index b2716805f7c..32a322220bc 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.205 2007/06/01 00:52:38 henning Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.206 2007/06/11 11:29:35 henning Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -607,13 +607,8 @@ findpcb:
}
if (inp == 0) {
int inpl_flags = 0;
-#if NPF > 0
- struct pf_mtag *t;
-
- if ((t = pf_find_mtag(m)) != NULL &&
- t->flags & PF_TAG_TRANSLATE_LOCALHOST)
+ if (m->m_pkthdr.pf.flags & PF_TAG_TRANSLATE_LOCALHOST)
inpl_flags = INPLOOKUP_WILDCARD;
-#endif
++tcpstat.tcps_pcbhashmiss;
switch (af) {
#ifdef INET6
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 838027d9d03..05ec0e1fe6f 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.113 2007/05/27 20:17:05 dlg Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.114 2007/06/11 11:29:35 henning Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -533,13 +533,8 @@ udp_input(struct mbuf *m, ...)
ip->ip_dst, uh->uh_dport);
if (inp == 0) {
int inpl_reverse = 0;
-#if NPF > 0
- struct pf_mtag *t;
-
- if ((t = pf_find_mtag(m)) != NULL &&
- t->flags & PF_TAG_TRANSLATE_LOCALHOST)
+ if (m->m_pkthdr.pf.flags & PF_TAG_TRANSLATE_LOCALHOST)
inpl_reverse = 1;
-#endif
++udpstat.udps_pcbhashmiss;
#ifdef INET6
if (ip6) {