Deleted Added
full compact
ng_gif.c (181803) ng_gif.c (183550)
1/*
2 * ng_gif.c
3 */
4
5/*-
6 * Copyright 2001 The Aerospace Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

57 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
58 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
59 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
62 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
63 * OF SUCH DAMAGE.
64 *
1/*
2 * ng_gif.c
3 */
4
5/*-
6 * Copyright 2001 The Aerospace Corporation. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

57 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
58 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
59 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
62 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
63 * OF SUCH DAMAGE.
64 *
65 * $FreeBSD: head/sys/netgraph/ng_gif.c 181803 2008-08-17 23:27:27Z bz $
65 * $FreeBSD: head/sys/netgraph/ng_gif.c 183550 2008-10-02 15:37:58Z zec $
66 */
67
68/*
69 * ng_gif(4) netgraph node type
70 */
71
72#include <sys/param.h>
73#include <sys/systm.h>

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

536******************************************************************/
537
538/*
539 * Handle loading and unloading for this node type.
540 */
541static int
542ng_gif_mod_event(module_t mod, int event, void *data)
543{
66 */
67
68/*
69 * ng_gif(4) netgraph node type
70 */
71
72#include <sys/param.h>
73#include <sys/systm.h>

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

536******************************************************************/
537
538/*
539 * Handle loading and unloading for this node type.
540 */
541static int
542ng_gif_mod_event(module_t mod, int event, void *data)
543{
544 VNET_ITERATOR_DECL(vnet_iter);
544 struct ifnet *ifp;
545 int error = 0;
546 int s;
547
548 s = splnet();
549 switch (event) {
550 case MOD_LOAD:
551

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

556 }
557 ng_gif_attach_p = ng_gif_attach;
558 ng_gif_detach_p = ng_gif_detach;
559 ng_gif_input_p = ng_gif_input;
560 ng_gif_input_orphan_p = ng_gif_input_orphan;
561
562 /* Create nodes for any already-existing gif interfaces */
563 IFNET_RLOCK();
545 struct ifnet *ifp;
546 int error = 0;
547 int s;
548
549 s = splnet();
550 switch (event) {
551 case MOD_LOAD:
552

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

557 }
558 ng_gif_attach_p = ng_gif_attach;
559 ng_gif_detach_p = ng_gif_detach;
560 ng_gif_input_p = ng_gif_input;
561 ng_gif_input_orphan_p = ng_gif_input_orphan;
562
563 /* Create nodes for any already-existing gif interfaces */
564 IFNET_RLOCK();
564 TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
565 if (ifp->if_type == IFT_GIF)
566 ng_gif_attach(ifp);
565 VNET_LIST_RLOCK();
566 VNET_FOREACH(vnet_iter) {
567 CURVNET_SET_QUIET(vnet_iter); /* XXX revisit quiet */
568 INIT_VNET_NET(curvnet);
569 TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
570 if (ifp->if_type == IFT_GIF)
571 ng_gif_attach(ifp);
572 }
573 CURVNET_RESTORE();
567 }
574 }
575 VNET_LIST_RUNLOCK();
568 IFNET_RUNLOCK();
569 break;
570
571 case MOD_UNLOAD:
572
573 /*
574 * Note that the base code won't try to unload us until
575 * all nodes have been removed, and that can't happen

--- 22 unchanged lines hidden ---
576 IFNET_RUNLOCK();
577 break;
578
579 case MOD_UNLOAD:
580
581 /*
582 * Note that the base code won't try to unload us until
583 * all nodes have been removed, and that can't happen

--- 22 unchanged lines hidden ---