if_disc.c (167897) | if_disc.c (173076) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 |
30 * $FreeBSD: head/sys/net/if_disc.c 167897 2007-03-26 09:10:28Z yar $ | 30 * $FreeBSD: head/sys/net/if_disc.c 173076 2007-10-27 19:57:41Z yar $ |
31 */ 32 33/* 34 * Discard interface driver for protocol testing and timing. 35 * (Based on the loopback.) 36 */ 37 38#include <sys/param.h> --- 48 unchanged lines hidden (view full) --- 87 if (ifp == NULL) { 88 free(sc, M_DISC); 89 return (ENOSPC); 90 } 91 92 ifp->if_softc = sc; 93 if_initname(ifp, ifc->ifc_name, unit); 94 ifp->if_mtu = DSMTU; | 31 */ 32 33/* 34 * Discard interface driver for protocol testing and timing. 35 * (Based on the loopback.) 36 */ 37 38#include <sys/param.h> --- 48 unchanged lines hidden (view full) --- 87 if (ifp == NULL) { 88 free(sc, M_DISC); 89 return (ENOSPC); 90 } 91 92 ifp->if_softc = sc; 93 if_initname(ifp, ifc->ifc_name, unit); 94 ifp->if_mtu = DSMTU; |
95 /* 96 * IFF_LOOPBACK should not be removed from disc's flags because 97 * it controls what PF-specific routes are magically added when 98 * a network address is assigned to the interface. Things just 99 * won't work as intended w/o such routes because the output 100 * interface selection for a packet is totally route-driven. 101 * A valid alternative to IFF_LOOPBACK can be IFF_BROADCAST or 102 * IFF_POINTOPOINT, but it would result in different properties 103 * of the interface. 104 */ |
|
95 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST; 96 ifp->if_drv_flags = IFF_DRV_RUNNING; 97 ifp->if_ioctl = discioctl; 98 ifp->if_output = discoutput; 99 ifp->if_hdrlen = 0; 100 ifp->if_addrlen = 0; 101 ifp->if_snd.ifq_maxlen = 20; 102 if_attach(ifp); --- 133 unchanged lines hidden --- | 105 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST; 106 ifp->if_drv_flags = IFF_DRV_RUNNING; 107 ifp->if_ioctl = discioctl; 108 ifp->if_output = discoutput; 109 ifp->if_hdrlen = 0; 110 ifp->if_addrlen = 0; 111 ifp->if_snd.ifq_maxlen = 20; 112 if_attach(ifp); --- 133 unchanged lines hidden --- |