Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2010 19:03:49 +0000 (UTC)
From:      Max Khon <fjoe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201924 - head/sys/netgraph
Message-ID:  <201001091903.o09J3ngu088304@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
+	}
 }
 
 /******************************************************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001091903.o09J3ngu088304>