Author: fjoe
Date: Sat Jan  9 19:03:48 2010
New Revision: 201924
URL: http://svn.freebsd.org/changeset/base/201924

Log:
  Send link state change control messages to "orphans" hook as well.
  
  MFC after:    1 week

Modified:
  head/sys/netgraph/ng_ether.c

Modified: head/sys/netgraph/ng_ether.c
==============================================================================
--- head/sys/netgraph/ng_ether.c        Sat Jan  9 19:02:33 2010        
(r201923)
+++ head/sys/netgraph/ng_ether.c        Sat Jan  9 19:03:48 2010        
(r201924)
@@ -359,9 +359,6 @@ ng_ether_link_state(struct ifnet *ifp, i
        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, i
        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);
+       }
 }
 
 /******************************************************************
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to