diff options
author | glebius <glebius@FreeBSD.org> | 2004-10-12 10:33:42 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2004-10-12 10:33:42 +0000 |
commit | 30124ad8837dc84bb315a5a390b05d30636bada2 (patch) | |
tree | a5ded4c665031b36a0b508afb62b7435a0f6c875 /sys/netgraph | |
parent | 13008687d43d8b904d17f862f9f9a7d2ffe7d5f9 (diff) | |
download | FreeBSD-src-30124ad8837dc84bb315a5a390b05d30636bada2.zip FreeBSD-src-30124ad8837dc84bb315a5a390b05d30636bada2.tar.gz |
Fix packet flow when both ng_ether(4) and bridge(4) are in use:
- push all bridge logic from if_ethersubr.c into bridge.c
make bridge_in() return mbuf pointer (or NULL).
- call only bridge_in() from ether_input(), after ng_ether_input()
was optinally called.
- call bridge_in() from ng_ether_rcv_upper().
Long description: http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html
Reported by: Jian-Wei Wang <jwwang at FreeBSD.csie.NCTU.edu.tw>
Tested by: myself, Sergey Lyubka
Reviewed by: sam
Approved by: julian (mentor)
MFC after: 2 months
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_ether.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 46d64c4..1682fc1 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -53,6 +53,7 @@ #include <sys/syslog.h> #include <sys/socket.h> +#include <net/bridge.h> #include <net/if.h> #include <net/if_types.h> #include <net/if_arp.h> @@ -552,6 +553,10 @@ ng_ether_rcv_upper(node_p node, struct mbuf *m) m->m_pkthdr.rcvif = priv->ifp; + if (BDG_ACTIVE(priv->ifp) ) + if ((m = bridge_in_ptr(priv->ifp, m)) == NULL) + return (0); + /* Route packet back in */ ether_demux(priv->ifp, m); return (0); |