diff options
author | Sam Leffler <sam@FreeBSD.org> | 2003-01-23 21:06:48 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2003-01-23 21:06:48 +0000 |
commit | e1b7c4cdaa276a21e66dc41dc066ac341c49e76e (patch) | |
tree | d2e1c972b1a11c9e5917d9b562c27261bbd16600 /sys/net | |
parent | aacc1f035755257da66bd6d5888ac10d3c3b2965 (diff) | |
download | src-e1b7c4cdaa276a21e66dc41dc066ac341c49e76e.tar.gz src-e1b7c4cdaa276a21e66dc41dc066ac341c49e76e.zip |
MFC: m_tag support
Replace aux mbufs with packet tags:
o instead of a list of mbufs use a list of m_tag structures a la openbsd
o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit
ABI/module number cookie
o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and
use this in defining openbsd-compatible m_tag_find and m_tag_get routines
o rewrite KAME use of aux mbufs in terms of packet tags
o eliminate the most heavily used aux mbufs by adding an additional struct
inpcb parameter to ip_output and ip6_output to allow the IPsec code to
locate the security policy to apply to outbound packets
o bump __FreeBSD_version so code can be conditionalized
o fixup ipfilter's call to ip_output based on __FreeBSD_version
Notes
Notes:
svn path=/stable/4/; revision=109753
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bridge.c | 2 | ||||
-rw-r--r-- | sys/net/if_gre.c | 2 | ||||
-rw-r--r-- | sys/net/if_loop.c | 8 | ||||
-rw-r--r-- | sys/net/if_stf.c | 2 |
4 files changed, 6 insertions, 8 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 220d78285b35..842b3ea7540b 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -815,7 +815,7 @@ bdg_forward(struct mbuf *m0, struct ether_header *const eh, struct ifnet *dst) 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) { + if (m0->_m_tag_id == PACKET_TAG_DUMMYNET) { args.rule = ((struct dn_pkt *)m0)->rule; shared = 0; /* For sure this is our own mbuf. */ } diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 54687649a384..7e085debfdb3 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -412,7 +412,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, ifp->if_opackets++; ifp->if_obytes += m->m_pkthdr.len; /* send it off */ - error = ip_output(m, NULL, &sc->route, 0, NULL); + error = ip_output(m, NULL, &sc->route, 0, NULL, NULL); end: sc->called = 0; if (error) diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 057557111072..bcb3099dfb23 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -154,17 +154,15 @@ looutput(ifp, m, dst, rt) MGETHDR(n, M_DONTWAIT, MT_HEADER); if (!n) goto contiguousfail; + M_MOVE_PKTHDR(n, m); MCLGET(n, M_DONTWAIT); if (! (n->m_flags & M_EXT)) { m_freem(n); goto contiguousfail; } - m_copydata(m, 0, m->m_pkthdr.len, mtod(n, caddr_t)); - n->m_pkthdr = m->m_pkthdr; - n->m_len = m->m_pkthdr.len; - n->m_pkthdr.aux = m->m_pkthdr.aux; - m->m_pkthdr.aux = (struct mbuf *)NULL; + m_copydata(m, 0, n->m_pkthdr.len, mtod(n, caddr_t)); + n->m_len = n->m_pkthdr.len; m_freem(m); m = n; } diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 82cefa6a5576..771516f5ca86 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -436,7 +436,7 @@ stf_output(ifp, m, dst, rt) } } - return ip_output(m, NULL, &sc->sc_ro, 0, NULL); + return ip_output(m, NULL, &sc->sc_ro, 0, NULL, NULL); } static int |