if_fddisubr.c (104302) | if_fddisubr.c (105577) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Matt Thomas <matt@3am-software.com>. All rights reserved. 4 * Copyright (c) 1982, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp | 1/* 2 * Copyright (c) 1995, 1996 3 * Matt Thomas <matt@3am-software.com>. All rights reserved. 4 * Copyright (c) 1982, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp |
36 * $FreeBSD: head/sys/net/if_fddisubr.c 104302 2002-10-01 15:48:31Z phk $ | 36 * $FreeBSD: head/sys/net/if_fddisubr.c 105577 2002-10-20 22:27:59Z rwatson $ |
37 */ 38 39#include "opt_atalk.h" 40#include "opt_inet.h" 41#include "opt_inet6.h" 42#include "opt_ipx.h" | 37 */ 38 39#include "opt_atalk.h" 40#include "opt_inet.h" 41#include "opt_inet6.h" 42#include "opt_ipx.h" |
43#include "opt_mac.h" |
|
43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/kernel.h> | 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/kernel.h> |
48#include <sys/mac.h> |
|
47#include <sys/malloc.h> 48#include <sys/mbuf.h> 49#include <sys/module.h> 50#include <sys/socket.h> 51#include <sys/sockio.h> 52 53#include <net/if.h> 54#include <net/if_llc.h> --- 64 unchanged lines hidden (view full) --- 119{ 120 u_int16_t type; 121 int loop_copy = 0, error = 0, hdrcmplt = 0; 122 u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN]; 123 struct rtentry *rt; 124 struct fddi_header *fh; 125 struct arpcom *ac = IFP2AC(ifp); 126 | 49#include <sys/malloc.h> 50#include <sys/mbuf.h> 51#include <sys/module.h> 52#include <sys/socket.h> 53#include <sys/sockio.h> 54 55#include <net/if.h> 56#include <net/if_llc.h> --- 64 unchanged lines hidden (view full) --- 121{ 122 u_int16_t type; 123 int loop_copy = 0, error = 0, hdrcmplt = 0; 124 u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN]; 125 struct rtentry *rt; 126 struct fddi_header *fh; 127 struct arpcom *ac = IFP2AC(ifp); 128 |
129#ifdef MAC 130 error = mac_check_ifnet_transmit(ifp, m); 131 if (error) 132 senderr(error); 133#endif 134 |
|
127 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 128 senderr(ENETDOWN); 129 getmicrotime(&ifp->if_lastchange); 130 if ((rt = rt0) != NULL) { 131 if ((rt->rt_flags & RTF_UP) == 0) { 132 if ((rt0 = rt = rtalloc1(dst, 1, 0UL)) != NULL) 133 rt->rt_refcnt--; 134 else --- 224 unchanged lines hidden (view full) --- 359 struct llc *l; 360 361 /* 362 * Discard packet if interface is not up. 363 */ 364 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 365 goto dropanyway; 366 | 135 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 136 senderr(ENETDOWN); 137 getmicrotime(&ifp->if_lastchange); 138 if ((rt = rt0) != NULL) { 139 if ((rt->rt_flags & RTF_UP) == 0) { 140 if ((rt0 = rt = rtalloc1(dst, 1, 0UL)) != NULL) 141 rt->rt_refcnt--; 142 else --- 224 unchanged lines hidden (view full) --- 367 struct llc *l; 368 369 /* 370 * Discard packet if interface is not up. 371 */ 372 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 373 goto dropanyway; 374 |
375#ifdef MAC 376 mac_create_mbuf_from_ifnet(ifp, m); 377#endif 378 |
|
367 /* 368 * Discard non local unicast packets when interface 369 * is in promiscuous mode. 370 */ 371 if ((ifp->if_flags & IFF_PROMISC) && ((fh->fddi_dhost[0] & 1) == 0) && 372 (bcmp(IFP2AC(ifp)->ac_enaddr, (caddr_t)fh->fddi_dhost, 373 FDDI_ADDR_LEN) != 0)) 374 goto dropanyway; --- 378 unchanged lines hidden --- | 379 /* 380 * Discard non local unicast packets when interface 381 * is in promiscuous mode. 382 */ 383 if ((ifp->if_flags & IFF_PROMISC) && ((fh->fddi_dhost[0] & 1) == 0) && 384 (bcmp(IFP2AC(ifp)->ac_enaddr, (caddr_t)fh->fddi_dhost, 385 FDDI_ADDR_LEN) != 0)) 386 goto dropanyway; --- 378 unchanged lines hidden --- |