summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-02-13 19:14:16 +0000
committermlaier <mlaier@FreeBSD.org>2004-02-13 19:14:16 +0000
commitda4d773b129fb1339d7b5fc23b93388b18952d3b (patch)
tree75fdee3c73dd1369e60e6348343749bdf159313a /sys/net
parent09ad0862e6acad72dd0217846a1c16d5bea5c454 (diff)
downloadFreeBSD-src-da4d773b129fb1339d7b5fc23b93388b18952d3b.zip
FreeBSD-src-da4d773b129fb1339d7b5fc23b93388b18952d3b.tar.gz
This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacing
them mostly with packet tags (one case is handled by using an mbuf flag since the linkage between "caller" and "callee" is direct and there's no need to incur the overhead of a packet tag). This is (mostly) work from: sam Silence from: -arch Approved by: bms(mentor), sam, rwatson
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bridge.c14
-rw-r--r--sys/net/if_ethersubr.c17
2 files changed, 7 insertions, 24 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index a444f1c..9ca1dd8 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -920,14 +920,11 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
DDB(quad_t ticks; ticks = rdtsc();)
- args.rule = NULL; /* did we match a firewall rule ? */
- /* Fetch state from dummynet tag, ignore others */
- for (;m0->m_type == MT_TAG; m0 = m0->m_next)
- if (m0->_m_tag_id == PACKET_TAG_DUMMYNET) {
- args.rule = ((struct dn_pkt *)m0)->rule;
- shared = 0; /* For sure this is our own mbuf. */
- }
- if (args.rule == NULL)
+ /* did we match a firewall rule ? */
+ args.rule = ip_dn_find_rule(m0);
+ if (args.rule)
+ shared = 0; /* For sure this is our own mbuf. */
+ else
bdg_thru++; /* count 1st time through bdg_forward */
/*
@@ -1046,7 +1043,6 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
args.m = m0; /* the packet we are looking at */
args.oif = NULL; /* this is an input packet */
- args.divert_rule = 0; /* we do not support divert yet */
args.next_hop = NULL; /* we do not support forward yet */
args.eh = &save_eh; /* MAC header for bridged/MAC packets */
i = ip_fw_chk_ptr(&args);
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 70eb9f7..7af66b3 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -322,12 +322,7 @@ bad: if (m != NULL)
int
ether_output_frame(struct ifnet *ifp, struct mbuf *m)
{
- struct ip_fw *rule = NULL;
-
- /* Extract info from dummynet tag, ignore others */
- for (; m->m_type == MT_TAG; m = m->m_next)
- if (m->m_flags == PACKET_TAG_DUMMYNET)
- rule = ((struct dn_pkt *)m)->rule;
+ struct ip_fw *rule = ip_dn_find_rule(m);
if (rule == NULL && BDG_ACTIVE(ifp)) {
/*
@@ -397,7 +392,6 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
args.m = m; /* the packet we are looking at */
args.oif = dst; /* destination, if any */
- args.divert_rule = 0; /* we do not support divert yet */
args.rule = *rule; /* matching rule to restart */
args.next_hop = NULL; /* we do not support forward yet */
args.eh = &save_eh; /* MAC header for bridged/MAC packets */
@@ -611,14 +605,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
#if defined(NETATALK)
struct llc *l;
#endif
- struct ip_fw *rule = NULL;
-
- /* Extract info from dummynet tag, ignore others */
- for (;m->m_type == MT_TAG; m = m->m_next)
- if (m->m_flags == PACKET_TAG_DUMMYNET) {
- rule = ((struct dn_pkt *)m)->rule;
- ifp = m->m_next->m_pkthdr.rcvif;
- }
+ struct ip_fw *rule = ip_dn_find_rule(m);
KASSERT(ifp != NULL, ("ether_demux: NULL interface pointer"));
OpenPOWER on IntegriCloud