ng_ether.c (193744) | ng_ether.c (194012) |
---|---|
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 193744 2009-06-08 19:57:35Z bz $ | 42 * $FreeBSD: head/sys/netgraph/ng_ether.c 194012 2009-06-11 16:50:49Z zec $ |
43 */ 44 45/* 46 * ng_ether(4) netgraph node type 47 */ 48 49#include <sys/param.h> 50#include <sys/systm.h> --- 226 unchanged lines hidden (view full) --- 277 const priv_p priv = NG_NODE_PRIVATE(node); 278 int error = 0; 279 280 /* If "upper" hook not connected, let packet continue */ 281 if (priv->upper == NULL) 282 return (0); 283 284 /* Send it out "upper" hook */ | 43 */ 44 45/* 46 * ng_ether(4) netgraph node type 47 */ 48 49#include <sys/param.h> 50#include <sys/systm.h> --- 226 unchanged lines hidden (view full) --- 277 const priv_p priv = NG_NODE_PRIVATE(node); 278 int error = 0; 279 280 /* If "upper" hook not connected, let packet continue */ 281 if (priv->upper == NULL) 282 return (0); 283 284 /* Send it out "upper" hook */ |
285 NG_OUTBOUND_THREAD_REF(); |
|
285 NG_SEND_DATA_ONLY(error, priv->upper, *mp); | 286 NG_SEND_DATA_ONLY(error, priv->upper, *mp); |
287 NG_OUTBOUND_THREAD_UNREF(); |
|
286 return (error); 287} 288 289/* 290 * A new Ethernet interface has been attached. 291 * Create a new node for it, etc. 292 */ 293static void --- 117 unchanged lines hidden (view full) --- 411 /* Divert hook is an alias for lower */ 412 if (strcmp(name, NG_ETHER_HOOK_DIVERT) == 0) 413 name = NG_ETHER_HOOK_LOWER; 414 415 /* Which hook? */ 416 if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) { 417 hookptr = &priv->upper; 418 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper); | 288 return (error); 289} 290 291/* 292 * A new Ethernet interface has been attached. 293 * Create a new node for it, etc. 294 */ 295static void --- 117 unchanged lines hidden (view full) --- 413 /* Divert hook is an alias for lower */ 414 if (strcmp(name, NG_ETHER_HOOK_DIVERT) == 0) 415 name = NG_ETHER_HOOK_LOWER; 416 417 /* Which hook? */ 418 if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) { 419 hookptr = &priv->upper; 420 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper); |
421 NG_HOOK_SET_TO_INBOUND(hook); |
|
419 } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) { 420 hookptr = &priv->lower; 421 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); 422 } else if (strcmp(name, NG_ETHER_HOOK_ORPHAN) == 0) { 423 hookptr = &priv->orphan; 424 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); 425 } else 426 return (EINVAL); --- 411 unchanged lines hidden --- | 422 } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) { 423 hookptr = &priv->lower; 424 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); 425 } else if (strcmp(name, NG_ETHER_HOOK_ORPHAN) == 0) { 426 hookptr = &priv->orphan; 427 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower); 428 } else 429 return (EINVAL); --- 411 unchanged lines hidden --- |