ng_ether.c (196019) | ng_ether.c (201924) |
---|---|
1 2/* 3 * ng_ether.c 4 */ 5 6/*- 7 * Copyright (c) 1996-2000 Whistle Communications, Inc. 8 * All rights reserved. --- 25 unchanged lines hidden (view full) --- 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 36 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 37 * OF SUCH DAMAGE. 38 * 39 * Authors: Archie Cobbs <archie@freebsd.org> 40 * Julian Elischer <julian@freebsd.org> 41 * | 1 2/* 3 * ng_ether.c 4 */ 5 6/*- 7 * Copyright (c) 1996-2000 Whistle Communications, Inc. 8 * All rights reserved. --- 25 unchanged lines hidden (view full) --- 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 36 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 37 * OF SUCH DAMAGE. 38 * 39 * Authors: Archie Cobbs <archie@freebsd.org> 40 * Julian Elischer <julian@freebsd.org> 41 * |
42 * $FreeBSD: head/sys/netgraph/ng_ether.c 196019 2009-08-01 19:26:27Z rwatson $ | 42 * $FreeBSD: head/sys/netgraph/ng_ether.c 201924 2010-01-09 19:03:48Z fjoe $ |
43 */ 44 45/* 46 * ng_ether(4) netgraph node type 47 */ 48 49#include <sys/param.h> 50#include <sys/systm.h> --- 303 unchanged lines hidden (view full) --- 354static void 355ng_ether_link_state(struct ifnet *ifp, int state) 356{ 357 const node_p node = IFP2NG(ifp); 358 const priv_p priv = NG_NODE_PRIVATE(node); 359 struct ng_mesg *msg; 360 int cmd, dummy_error = 0; 361 | 43 */ 44 45/* 46 * ng_ether(4) netgraph node type 47 */ 48 49#include <sys/param.h> 50#include <sys/systm.h> --- 303 unchanged lines hidden (view full) --- 354static void 355ng_ether_link_state(struct ifnet *ifp, int state) 356{ 357 const node_p node = IFP2NG(ifp); 358 const priv_p priv = NG_NODE_PRIVATE(node); 359 struct ng_mesg *msg; 360 int cmd, dummy_error = 0; 361 |
362 if (priv->lower == NULL) 363 return; 364 | |
365 if (state == LINK_STATE_UP) 366 cmd = NGM_LINK_IS_UP; 367 else if (state == LINK_STATE_DOWN) 368 cmd = NGM_LINK_IS_DOWN; 369 else 370 return; 371 | 362 if (state == LINK_STATE_UP) 363 cmd = NGM_LINK_IS_UP; 364 else if (state == LINK_STATE_DOWN) 365 cmd = NGM_LINK_IS_DOWN; 366 else 367 return; 368 |
372 NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); 373 if (msg != NULL) 374 NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0); | 369 if (priv->lower != NULL) { 370 NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); 371 if (msg != NULL) 372 NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0); 373 } 374 if (priv->orphan != NULL) { 375 NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); 376 if (msg != NULL) 377 NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->orphan, 0); 378 } |
375} 376 377/****************************************************************** 378 NETGRAPH NODE METHODS 379******************************************************************/ 380 381/* 382 * It is not possible or allowable to create a node of this type. --- 441 unchanged lines hidden --- | 379} 380 381/****************************************************************** 382 NETGRAPH NODE METHODS 383******************************************************************/ 384 385/* 386 * It is not possible or allowable to create a node of this type. --- 441 unchanged lines hidden --- |