1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */
2/* $FreeBSD: head/sys/net/if_gre.c 241610 2012-10-16 13:37:54Z glebius $ */
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 *
--- 502 unchanged lines hidden (view full) ---
513
514static int
515gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
516{
517 struct ifreq *ifr = (struct ifreq *)data;
518 struct if_laddrreq *lifr = (struct if_laddrreq *)data;
519 struct in_aliasreq *aifr = (struct in_aliasreq *)data;
520 struct gre_softc *sc = ifp->if_softc;
521 int s;
522 struct sockaddr_in si;
523 struct sockaddr *sa = NULL;
524 int error, adj;
525 struct sockaddr_in sp, sm, dp, dm;
526 uint32_t key;
527
528 error = 0;
529 adj = 0;
530
531 s = splnet();
532 switch (cmd) {
533 case SIOCSIFADDR:
534 ifp->if_flags |= IFF_UP;
535 break;
536 case SIOCSIFDSTADDR:
537 break;
538 case SIOCSIFFLAGS:
539 /*
--- 303 unchanged lines hidden (view full) ---
843 error = copyout(&sc->key, ifr->ifr_data, sizeof(sc->key));
844 break;
845
846 default:
847 error = EINVAL;
848 break;
849 }
850
851 splx(s);
852 return (error);
853}
854
855/*
856 * computes a route to our destination that is not the one
857 * which would be taken by ip_output(), as this one will loop back to
858 * us. If the interface is p2p as a--->b, then a routing entry exists
859 * If we now send a packet to b (e.g. ping b), this will come down here
--- 121 unchanged lines hidden ---
2/* $FreeBSD: head/sys/net/if_gre.c 241610 2012-10-16 13:37:54Z glebius $ */
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 *
--- 502 unchanged lines hidden (view full) ---
513
514static int
515gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
516{
517 struct ifreq *ifr = (struct ifreq *)data;
518 struct if_laddrreq *lifr = (struct if_laddrreq *)data;
519 struct in_aliasreq *aifr = (struct in_aliasreq *)data;
520 struct gre_softc *sc = ifp->if_softc;
521 int s;
522 struct sockaddr_in si;
523 struct sockaddr *sa = NULL;
524 int error, adj;
525 struct sockaddr_in sp, sm, dp, dm;
526 uint32_t key;
527
528 error = 0;
529 adj = 0;
530
531 s = splnet();
532 switch (cmd) {
533 case SIOCSIFADDR:
534 ifp->if_flags |= IFF_UP;
535 break;
536 case SIOCSIFDSTADDR:
537 break;
538 case SIOCSIFFLAGS:
539 /*
--- 303 unchanged lines hidden (view full) ---
843 error = copyout(&sc->key, ifr->ifr_data, sizeof(sc->key));
844 break;
845
846 default:
847 error = EINVAL;
848 break;
849 }
850
851 splx(s);
852 return (error);
853}
854
855/*
856 * computes a route to our destination that is not the one
857 * which would be taken by ip_output(), as this one will loop back to
858 * us. If the interface is p2p as a--->b, then a routing entry exists
859 * If we now send a packet to b (e.g. ping b), this will come down here
--- 121 unchanged lines hidden ---