Deleted Added
full compact
ng_eiface.c (191510) ng_eiface.c (194012)
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:

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
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:

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

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/netgraph/ng_eiface.c 191510 2009-04-26 07:14:50Z zec $
28 * $FreeBSD: head/sys/netgraph/ng_eiface.c 194012 2009-06-11 16:50:49Z zec $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/errno.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/mbuf.h>

--- 219 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 */
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/errno.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/mbuf.h>

--- 219 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 ---