if_gre.c (241610) | if_gre.c (241686) |
---|---|
1/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ | 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 $ */ | 2/* $FreeBSD: head/sys/net/if_gre.c 241686 2012-10-18 13:57:24Z andre $ */ |
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; | 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 | 521 struct sockaddr_in si; 522 struct sockaddr *sa = NULL; 523 int error, adj; 524 struct sockaddr_in sp, sm, dp, dm; 525 uint32_t key; 526 527 error = 0; 528 adj = 0; 529 |
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 | 530 switch (cmd) { 531 case SIOCSIFADDR: 532 ifp->if_flags |= IFF_UP; 533 break; 534 case SIOCSIFDSTADDR: 535 break; 536 case SIOCSIFFLAGS: 537 /* --- 303 unchanged lines hidden (view full) --- 841 error = copyout(&sc->key, ifr->ifr_data, sizeof(sc->key)); 842 break; 843 844 default: 845 error = EINVAL; 846 break; 847 } 848 |
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 --- | 849 return (error); 850} 851 852/* 853 * computes a route to our destination that is not the one 854 * which would be taken by ip_output(), as this one will loop back to 855 * us. If the interface is p2p as a--->b, then a routing entry exists 856 * If we now send a packet to b (e.g. ping b), this will come down here --- 121 unchanged lines hidden --- |