From c4307a79b8c7bec1db6427f2dde7459081cab8f9 Mon Sep 17 00:00:00 2001 From: glebius Date: Tue, 23 Nov 2004 09:48:13 +0000 Subject: [PATCH] Netgraph flow control: change interface status when node receive LINK_IS_UP/LINK_IS_DOWN messages. Approved by: julian (mentor), implicitly MFC after: 1 week --- sys/netgraph/ng_iface.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 67ad539ec48f..e31e97bc346a 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -730,6 +730,18 @@ ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook) break; } break; + case NGM_FLOW_COOKIE: + switch (msg->header.cmd) { + case NGM_LINK_IS_UP: + ifp->if_flags |= IFF_UP; + break; + case NGM_LINK_IS_DOWN: + ifp->if_flags &= ~IFF_UP; + break; + default: + break; + } + break; default: error = EINVAL; break;