summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2009-12-28 10:47:04 +0000
committerluigi <luigi@FreeBSD.org>2009-12-28 10:47:04 +0000
commit483862a5a29b9346fa21b1e610575cc357fe333b (patch)
tree60f53a5bf8cc566164152cc4aafa059ac6abaa67 /sys/net/if_ethersubr.c
parentffe8fa8dada6df26645bc5af9810d8e7e565187b (diff)
downloadFreeBSD-src-483862a5a29b9346fa21b1e610575cc357fe333b.zip
FreeBSD-src-483862a5a29b9346fa21b1e610575cc357fe333b.tar.gz
bring in several cleanups tested in ipfw3-head branch, namely:
r201011 - move most of ng_ipfw.h into ip_fw_private.h, as this code is ipfw-specific. This removes a dependency on ng_ipfw.h from some files. - move many equivalent definitions of direction (IN, OUT) for reinjected packets into ip_fw_private.h - document the structure of the packet tags used for dummynet and netgraph; r201049 - merge some common code to attach/detach hooks into a single function. r201055 - remove some duplicated code in ip_fw_pfil. The input and output processing uses almost exactly the same code so there is no need to use two separate hooks. ip_fw_pfil.o goes from 2096 to 1382 bytes of .text r201057 (see the svn log for full details) - macros to make the conversion of ip_len and ip_off between host and network format more explicit r201113 (the remaining parts) - readability fixes -- put braces around some large for() blocks, localize variables so the compiler does not think they are uninitialized, do not insist on precise allocation size if we have more than we need. r201119 - when doing a lookup, keys must be in big endian format because this is what the radix code expects (this fixes a bug in the recently-introduced 'lookup' option) No ABI changes in this commit. MFC after: 1 week
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 95554ca..5fd53e8 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -467,13 +467,16 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared)
struct mbuf *m;
int i;
struct ip_fw_args args;
- struct dn_pkt_tag *dn_tag;
+ struct m_tag *mtag;
- dn_tag = ip_dn_claim_tag(*m0);
-
- if (dn_tag == NULL) {
+ mtag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL);
+ if (mtag == NULL) {
args.slot = 0;
} else {
+ struct dn_pkt_tag *dn_tag;
+
+ mtag->m_tag_id = PACKET_TAG_NONE;
+ dn_tag = (struct dn_pkt_tag *)(mtag + 1);
if (dn_tag->slot != 0 && V_fw_one_pass)
/* dummynet packet, already partially processed */
return (1);
@@ -532,6 +535,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared)
return 1;
if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) {
+ int dir;
/*
* Pass the pkt to dummynet, which consumes it.
* If shared, make a copy and keep the original.
@@ -547,7 +551,8 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared)
*/
*m0 = NULL ;
}
- ip_dn_io_ptr(&m, dst ? DN_TO_ETH_OUT: DN_TO_ETH_DEMUX, &args);
+ dir = PROTO_LAYER2 | (dst ? DIR_OUT : DIR_IN);
+ ip_dn_io_ptr(&m, dir, &args);
return 0;
}
/*
OpenPOWER on IntegriCloud