1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
2/* $FreeBSD: head/sys/net/if_gre.c 125020 2004-01-26 12:21:59Z sobomax $ */
3
4/*
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *
--- 162 unchanged lines hidden (view full) ---
173 sc->sc_if.if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
174 sc->sc_if.if_output = gre_output;
175 sc->sc_if.if_ioctl = gre_ioctl;
176 sc->g_dst.s_addr = sc->g_src.s_addr = INADDR_ANY;
177 sc->g_proto = IPPROTO_GRE;
178 sc->sc_if.if_flags |= IFF_LINK0;
179 sc->encap = NULL;
180 sc->called = 0;
181 if_attach(&sc->sc_if);
182 bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int32_t));
183 LIST_INSERT_HEAD(&gre_softc_list, sc, sc_list);
184 return (0);
185}
186
187static void
188gre_clone_destroy(ifp)
--- 213 unchanged lines hidden (view full) ---
402 break;
403 case SIOCSIFFLAGS:
404 if ((error = suser(curthread)) != 0)
405 break;
406 if ((ifr->ifr_flags & IFF_LINK0) != 0)
407 sc->g_proto = IPPROTO_GRE;
408 else
409 sc->g_proto = IPPROTO_MOBILE;
410 goto recompute;
411 case SIOCSIFMTU:
412 if ((error = suser(curthread)) != 0)
413 break;
414 if (ifr->ifr_mtu < 576) {
415 error = EINVAL;
416 break;
417 }
--- 331 unchanged lines hidden ---
2/* $FreeBSD: head/sys/net/if_gre.c 125020 2004-01-26 12:21:59Z sobomax $ */
3
4/*
5 * Copyright (c) 1998 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Heiko W.Rupp <hwr@pilhuhn.de>
10 *
--- 162 unchanged lines hidden (view full) ---
173 sc->sc_if.if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
174 sc->sc_if.if_output = gre_output;
175 sc->sc_if.if_ioctl = gre_ioctl;
176 sc->g_dst.s_addr = sc->g_src.s_addr = INADDR_ANY;
177 sc->g_proto = IPPROTO_GRE;
178 sc->sc_if.if_flags |= IFF_LINK0;
179 sc->encap = NULL;
180 sc->called = 0;
181 if_attach(&sc->sc_if);
182 bpfattach(&sc->sc_if, DLT_NULL, sizeof(u_int32_t));
183 LIST_INSERT_HEAD(&gre_softc_list, sc, sc_list);
184 return (0);
185}
186
187static void
188gre_clone_destroy(ifp)
--- 213 unchanged lines hidden (view full) ---
402 break;
403 case SIOCSIFFLAGS:
404 if ((error = suser(curthread)) != 0)
405 break;
406 if ((ifr->ifr_flags & IFF_LINK0) != 0)
407 sc->g_proto = IPPROTO_GRE;
408 else
409 sc->g_proto = IPPROTO_MOBILE;
410 goto recompute;
411 case SIOCSIFMTU:
412 if ((error = suser(curthread)) != 0)
413 break;
414 if (ifr->ifr_mtu < 576) {
415 error = EINVAL;
416 break;
417 }
--- 331 unchanged lines hidden ---