if_vlan.c (83115) | if_vlan.c (83130) |
---|---|
1/* 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/net/if_vlan.c 83115 2001-09-05 21:10:28Z brooks $ | 29 * $FreeBSD: head/sys/net/if_vlan.c 83130 2001-09-06 02:40:43Z jlemon $ |
30 */ 31 32/* 33 * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. 34 * Might be extended some day to also handle IEEE 802.1p priority 35 * tagging. This is sort of sneaky in the implementation, since 36 * we need to pretend to be enough of an Ethernet implementation 37 * to make arp work. The way we do this is by telling everyone --- 444 unchanged lines hidden (view full) --- 482 */ 483 ifv->ifv_if.if_flags = (p->if_flags & 484 (IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX | IFF_POINTOPOINT)); 485 486 /* 487 * Set up our ``Ethernet address'' to reflect the underlying 488 * physical interface's. 489 */ | 30 */ 31 32/* 33 * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs. 34 * Might be extended some day to also handle IEEE 802.1p priority 35 * tagging. This is sort of sneaky in the implementation, since 36 * we need to pretend to be enough of an Ethernet implementation 37 * to make arp work. The way we do this is by telling everyone --- 444 unchanged lines hidden (view full) --- 482 */ 483 ifv->ifv_if.if_flags = (p->if_flags & 484 (IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX | IFF_POINTOPOINT)); 485 486 /* 487 * Set up our ``Ethernet address'' to reflect the underlying 488 * physical interface's. 489 */ |
490 ifa1 = ifnet_addrs[ifv->ifv_if.if_index - 1]; 491 ifa2 = ifnet_addrs[p->if_index - 1]; | 490 ifa1 = ifaddr_byindex(ifv->ifv_if.if_index); 491 ifa2 = ifaddr_byindex(p->if_index); |
492 sdl1 = (struct sockaddr_dl *)ifa1->ifa_addr; 493 sdl2 = (struct sockaddr_dl *)ifa2->ifa_addr; 494 sdl1->sdl_type = IFT_ETHER; 495 sdl1->sdl_alen = ETHER_ADDR_LEN; 496 bcopy(LLADDR(sdl2), LLADDR(sdl1), ETHER_ADDR_LEN); 497 bcopy(LLADDR(sdl2), ifv->ifv_ac.ac_enaddr, ETHER_ADDR_LEN); 498 499 /* --- 44 unchanged lines hidden (view full) --- 544 } 545 } 546 547 /* Disconnect from parent. */ 548 ifv->ifv_p = NULL; 549 ifv->ifv_if.if_mtu = ETHERMTU; 550 551 /* Clear our MAC address. */ | 492 sdl1 = (struct sockaddr_dl *)ifa1->ifa_addr; 493 sdl2 = (struct sockaddr_dl *)ifa2->ifa_addr; 494 sdl1->sdl_type = IFT_ETHER; 495 sdl1->sdl_alen = ETHER_ADDR_LEN; 496 bcopy(LLADDR(sdl2), LLADDR(sdl1), ETHER_ADDR_LEN); 497 bcopy(LLADDR(sdl2), ifv->ifv_ac.ac_enaddr, ETHER_ADDR_LEN); 498 499 /* --- 44 unchanged lines hidden (view full) --- 544 } 545 } 546 547 /* Disconnect from parent. */ 548 ifv->ifv_p = NULL; 549 ifv->ifv_if.if_mtu = ETHERMTU; 550 551 /* Clear our MAC address. */ |
552 ifa = ifnet_addrs[ifv->ifv_if.if_index - 1]; | 552 ifa = ifaddr_byindex(ifv->ifv_if.if_index); |
553 sdl = (struct sockaddr_dl *)ifa->ifa_addr; 554 sdl->sdl_type = IFT_ETHER; 555 sdl->sdl_alen = ETHER_ADDR_LEN; 556 bzero(LLADDR(sdl), ETHER_ADDR_LEN); 557 bzero(ifv->ifv_ac.ac_enaddr, ETHER_ADDR_LEN); 558 559 return 0; 560} --- 109 unchanged lines hidden --- | 553 sdl = (struct sockaddr_dl *)ifa->ifa_addr; 554 sdl->sdl_type = IFT_ETHER; 555 sdl->sdl_alen = ETHER_ADDR_LEN; 556 bzero(LLADDR(sdl), ETHER_ADDR_LEN); 557 bzero(ifv->ifv_ac.ac_enaddr, ETHER_ADDR_LEN); 558 559 return 0; 560} --- 109 unchanged lines hidden --- |