if_gif.c (cfe30d02adda7c3b5c76156ac52d50d8cab325d9) | if_gif.c (e9f947e27c9168a1c9e4bb239e4a094941b4a417) |
---|---|
1/* $FreeBSD$ */ 2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 159 unchanged lines hidden (view full) --- 168 } 169 170 GIF_LOCK_INIT(sc); 171 172 GIF2IFP(sc)->if_softc = sc; 173 if_initname(GIF2IFP(sc), gifname, unit); 174 175 sc->encap_cookie4 = sc->encap_cookie6 = NULL; | 1/* $FreeBSD$ */ 2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 159 unchanged lines hidden (view full) --- 168 } 169 170 GIF_LOCK_INIT(sc); 171 172 GIF2IFP(sc)->if_softc = sc; 173 if_initname(GIF2IFP(sc), gifname, unit); 174 175 sc->encap_cookie4 = sc->encap_cookie6 = NULL; |
176 sc->gif_options = GIF_ACCEPT_REVETHIP; | 176 sc->gif_options = 0; |
177 178 GIF2IFP(sc)->if_addrlen = 0; 179 GIF2IFP(sc)->if_mtu = GIF_MTU; 180 GIF2IFP(sc)->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 181#if 0 182 /* turn off ingress filter */ 183 GIF2IFP(sc)->if_flags |= IFF_LINK2; 184#endif --- 247 unchanged lines hidden (view full) --- 432 uint32_t af; 433#ifdef MAC 434 error = mac_ifnet_check_transmit(ifp, m); 435 if (error) { 436 m_freem(m); 437 goto end; 438 } 439#endif | 177 178 GIF2IFP(sc)->if_addrlen = 0; 179 GIF2IFP(sc)->if_mtu = GIF_MTU; 180 GIF2IFP(sc)->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 181#if 0 182 /* turn off ingress filter */ 183 GIF2IFP(sc)->if_flags |= IFF_LINK2; 184#endif --- 247 unchanged lines hidden (view full) --- 432 uint32_t af; 433#ifdef MAC 434 error = mac_ifnet_check_transmit(ifp, m); 435 if (error) { 436 m_freem(m); 437 goto end; 438 } 439#endif |
440 if ((ifp->if_flags & IFF_MONITOR) != 0) { 441 error = ENETDOWN; 442 m_freem(m); 443 goto end; 444 } |
|
440 441 /* 442 * gif may cause infinite recursion calls when misconfigured. 443 * We'll prevent this by detecting loops. 444 * 445 * High nesting level may cause stack exhaustion. 446 * We'll prevent this by introducing upper limit. 447 */ --- 98 unchanged lines hidden (view full) --- 546 mac_ifnet_create_mbuf(ifp, m); 547#endif 548 549 if (bpf_peers_present(ifp->if_bpf)) { 550 u_int32_t af1 = af; 551 bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m); 552 } 553 | 445 446 /* 447 * gif may cause infinite recursion calls when misconfigured. 448 * We'll prevent this by detecting loops. 449 * 450 * High nesting level may cause stack exhaustion. 451 * We'll prevent this by introducing upper limit. 452 */ --- 98 unchanged lines hidden (view full) --- 551 mac_ifnet_create_mbuf(ifp, m); 552#endif 553 554 if (bpf_peers_present(ifp->if_bpf)) { 555 u_int32_t af1 = af; 556 bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m); 557 } 558 |
559 if ((ifp->if_flags & IFF_MONITOR) != 0) { 560 ifp->if_ipackets++; 561 ifp->if_ibytes += m->m_pkthdr.len; 562 m_freem(m); 563 return; 564 } 565 |
|
554 if (ng_gif_input_p != NULL) { 555 (*ng_gif_input_p)(ifp, &m, af); 556 if (m == NULL) 557 return; 558 } 559 560 /* 561 * Put the packet to the network layer input queue according to the --- 511 unchanged lines hidden --- | 566 if (ng_gif_input_p != NULL) { 567 (*ng_gif_input_p)(ifp, &m, af); 568 if (m == NULL) 569 return; 570 } 571 572 /* 573 * Put the packet to the network layer input queue according to the --- 511 unchanged lines hidden --- |