summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2005-10-14 02:38:47 +0000
committerthompsa <thompsa@FreeBSD.org>2005-10-14 02:38:47 +0000
commit117e7120fa181d5236c7e36d4f4fd5bc3811fbc8 (patch)
tree79681e5e8c326ab9ad2fb9850212ba23c6a8ec86 /sys/netgraph
parenta2a05b4695590e296794cfb6673385b755a86bfe (diff)
downloadFreeBSD-src-117e7120fa181d5236c7e36d4f4fd5bc3811fbc8.zip
FreeBSD-src-117e7120fa181d5236c7e36d4f4fd5bc3811fbc8.tar.gz
Further clean up the bridge hooks in if_ethersubr.c and ng_ether.c
- move the function pointer definitions to if_bridgevar.h - move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros - remove unneeded functions from if_bridgevar.h and sort a little.
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_ether.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index c493092..8937fc8 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -61,6 +61,7 @@
#include <net/if_arp.h>
#include <net/if_var.h>
#include <net/ethernet.h>
+#include <net/if_bridgevar.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
@@ -103,9 +104,6 @@ static void ng_ether_link_state(struct ifnet *ifp, int state);
static int ng_ether_rcv_lower(node_p node, struct mbuf *m);
static int ng_ether_rcv_upper(node_p node, struct mbuf *m);
-/* if_bridge(4) support. XXX: should go into some include. */
-extern struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *);
-
/* Netgraph node methods */
static ng_constructor_t ng_ether_constructor;
static ng_rcvmsg_t ng_ether_rcvmsg;
@@ -647,26 +645,15 @@ ng_ether_rcv_upper(node_p node, struct mbuf *m)
m->m_pkthdr.rcvif = ifp;
- /*
- * XXX: This is a copy'and'paste from if_ethersubr.c:ether_input()
- */
+ /* Pass the packet to the bridge, it may come back to us */
if (ifp->if_bridge) {
- KASSERT(bridge_input_p != NULL,
- ("%s: if_bridge not loaded!", __func__));
-
- m = (*bridge_input_p)(ifp, m);
+ BRIDGE_INPUT(ifp, m);
if (m == NULL)
return (0);
- /*
- * Bridge has determined that the packet is for us.
- * Update our interface pointer -- we may have had
- * to "bridge" the packet locally.
- */
- ifp = m->m_pkthdr.rcvif;
}
/* Route packet back in */
- ether_demux(priv->ifp, m);
+ ether_demux(ifp, m);
return (0);
}
OpenPOWER on IntegriCloud