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
This commit is contained in:
Gleb Smirnoff 2004-11-23 09:48:13 +00:00
parent 129353b81c
commit 28b24b7b1a

View File

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