Send link state change control messages to "orphans" hook as well.

MFC after:	1 week
This commit is contained in:
Max Khon 2010-01-09 19:03:48 +00:00
parent b00c1bf2e1
commit bb027e0647

View File

@ -359,9 +359,6 @@ ng_ether_link_state(struct ifnet *ifp, int state)
struct ng_mesg *msg;
int cmd, dummy_error = 0;
if (priv->lower == NULL)
return;
if (state == LINK_STATE_UP)
cmd = NGM_LINK_IS_UP;
else if (state == LINK_STATE_DOWN)
@ -369,9 +366,16 @@ ng_ether_link_state(struct ifnet *ifp, int state)
else
return;
NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
if (msg != NULL)
NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0);
if (priv->lower != NULL) {
NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
if (msg != NULL)
NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0);
}
if (priv->orphan != NULL) {
NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT);
if (msg != NULL)
NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->orphan, 0);
}
}
/******************************************************************