ng_iface.c (e7153b2583ec32ced588706fe1996d909b23bc3c) ng_iface.c (f089869fa51590b56e8fcbdb693f062b30e037bf)
1/*
2 * ng_iface.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 468 unchanged lines hidden (view full) ---

477 m_freem(m);
478 log(LOG_WARNING, "%s: can't handle af%d\n", ifp->if_xname, sa);
479 return (EAFNOSUPPORT);
480 }
481
482 /* Copy length before the mbuf gets invalidated. */
483 len = m->m_pkthdr.len;
484
1/*
2 * ng_iface.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 468 unchanged lines hidden (view full) ---

477 m_freem(m);
478 log(LOG_WARNING, "%s: can't handle af%d\n", ifp->if_xname, sa);
479 return (EAFNOSUPPORT);
480 }
481
482 /* Copy length before the mbuf gets invalidated. */
483 len = m->m_pkthdr.len;
484
485 /* Send packet. If hook is not connected,
486 mbuf will get freed. */
485 /* Send packet. If hook is not connected, mbuf will get freed. */
486 NG_OUTBOUND_THREAD_REF();
487 NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
487 NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
488 NG_OUTBOUND_THREAD_UNREF();
488
489 /* Update stats. */
490 if (error == 0) {
491 ifp->if_obytes += len;
492 ifp->if_opackets++;
493 }
494
495 return (error);

--- 109 unchanged lines hidden (view full) ---

605
606 if (iffam == NULL)
607 return (EPFNOSUPPORT);
608 hookptr = get_hook_from_iffam(NG_NODE_PRIVATE(node), iffam);
609 if (*hookptr != NULL)
610 return (EISCONN);
611 *hookptr = hook;
612 NG_HOOK_HI_STACK(hook);
489
490 /* Update stats. */
491 if (error == 0) {
492 ifp->if_obytes += len;
493 ifp->if_opackets++;
494 }
495
496 return (error);

--- 109 unchanged lines hidden (view full) ---

606
607 if (iffam == NULL)
608 return (EPFNOSUPPORT);
609 hookptr = get_hook_from_iffam(NG_NODE_PRIVATE(node), iffam);
610 if (*hookptr != NULL)
611 return (EISCONN);
612 *hookptr = hook;
613 NG_HOOK_HI_STACK(hook);
614 NG_HOOK_SET_TO_INBOUND(hook);
613 return (0);
614}
615
616/*
617 * Receive a control message
618 */
619static int
620ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)

--- 268 unchanged lines hidden ---
615 return (0);
616}
617
618/*
619 * Receive a control message
620 */
621static int
622ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)

--- 268 unchanged lines hidden ---