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

This commit is contained in:
Max Khon 2010-01-24 08:59:33 +00:00
parent 3bcceea40e
commit 3dd81e0306

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);
}
}
/******************************************************************