ng_eiface.c (e7153b2583ec32ced588706fe1996d909b23bc3c) ng_eiface.c (f089869fa51590b56e8fcbdb693f062b30e037bf)
1/*-
2 *
3 * Copyright (c) 1999-2001, Vitaly V Belekhov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

256 m_freem(m);
257 continue;
258 }
259
260 /*
261 * Send packet; if hook is not connected, mbuf will get
262 * freed.
263 */
1/*-
2 *
3 * Copyright (c) 1999-2001, Vitaly V Belekhov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

256 m_freem(m);
257 continue;
258 }
259
260 /*
261 * Send packet; if hook is not connected, mbuf will get
262 * freed.
263 */
264 NG_OUTBOUND_THREAD_REF();
264 NG_SEND_DATA_ONLY(error, priv->ether, m);
265 NG_SEND_DATA_ONLY(error, priv->ether, m);
266 NG_OUTBOUND_THREAD_UNREF();
265
266 /* Update stats */
267 if (error == 0)
268 ifp->if_opackets++;
269 else
270 ifp->if_oerrors++;
271 }
272

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

409 struct ifnet *ifp = priv->ifp;
410
411 if (strcmp(name, NG_EIFACE_HOOK_ETHER))
412 return (EPFNOSUPPORT);
413 if (priv->ether != NULL)
414 return (EISCONN);
415 priv->ether = hook;
416 NG_HOOK_SET_PRIVATE(hook, &priv->ether);
267
268 /* Update stats */
269 if (error == 0)
270 ifp->if_opackets++;
271 else
272 ifp->if_oerrors++;
273 }
274

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

411 struct ifnet *ifp = priv->ifp;
412
413 if (strcmp(name, NG_EIFACE_HOOK_ETHER))
414 return (EPFNOSUPPORT);
415 if (priv->ether != NULL)
416 return (EISCONN);
417 priv->ether = hook;
418 NG_HOOK_SET_PRIVATE(hook, &priv->ether);
419 NG_HOOK_SET_TO_INBOUND(hook);
417
418 if_link_state_change(ifp, LINK_STATE_UP);
419
420 return (0);
421}
422
423/*
424 * Receive a control message

--- 218 unchanged lines hidden ---
420
421 if_link_state_change(ifp, LINK_STATE_UP);
422
423 return (0);
424}
425
426/*
427 * Receive a control message

--- 218 unchanged lines hidden ---