When netgraph flow control message comes from downstream, broadcast

it to all vlans.

Sponsored by:	Rambler
This commit is contained in:
Gleb Smirnoff 2005-04-20 14:19:20 +00:00
parent 46917bb6f4
commit 3b1c41c548
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145330

View file

@ -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;