summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_vlan.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-04-20 14:19:20 +0000
committerglebius <glebius@FreeBSD.org>2005-04-20 14:19:20 +0000
commit8669186b104629a947f6555d29f3433e6ab1c648 (patch)
tree265ccaef7199ce2e7616cec3732e1bf78691215a /sys/netgraph/ng_vlan.c
parent01d6e824de62a24048b68e35302cfc0f88350192 (diff)
downloadFreeBSD-src-8669186b104629a947f6555d29f3433e6ab1c648.zip
FreeBSD-src-8669186b104629a947f6555d29f3433e6ab1c648.tar.gz
When netgraph flow control message comes from downstream, broadcast
it to all vlans. Sponsored by: Rambler
Diffstat (limited to 'sys/netgraph/ng_vlan.c')
-rw-r--r--sys/netgraph/ng_vlan.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/netgraph/ng_vlan.c b/sys/netgraph/ng_vlan.c
index cf94709..437f232 100644
--- a/sys/netgraph/ng_vlan.c
+++ b/sys/netgraph/ng_vlan.c
@@ -299,6 +299,34 @@ ng_vlan_rcvmsg(node_p node, item_p item, hook_p lasthook)
break;
}
break;
+ case NGM_FLOW_COOKIE:
+ {
+ struct ng_mesg *copy;
+ struct filterhead *chain;
+ struct filter *f;
+
+ /*
+ * Flow control messages should come only
+ * from downstream.
+ */
+
+ if (lasthook == NULL)
+ break;
+ if (lasthook != priv->downstream_hook)
+ break;
+
+ /* Broadcast the event to all uplinks. */
+ for (i = 0, chain = priv->hashtable; i < HASHSIZE;
+ i++, chain++)
+ LIST_FOREACH(f, chain, next) {
+ NG_COPYMESSAGE(copy, msg, M_NOWAIT);
+ if (copy == NULL)
+ continue;
+ NG_SEND_MSG_HOOK(error, node, copy, f->hook, 0);
+ }
+
+ break;
+ }
default: /* Unknown type cookie. */
error = EINVAL;
break;
OpenPOWER on IntegriCloud