1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 16 unchanged lines hidden (view full) --- 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 * $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/in6_ifattach.c 252511 2013-07-02 16:58:15Z hrs $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/malloc.h> 38#include <sys/socket.h> 39#include <sys/sockio.h> 40#include <sys/jail.h> 41#include <sys/kernel.h> --- 219 unchanged lines hidden (view full) --- 261 262found: 263 IF_ADDR_LOCK_ASSERT(ifp); 264 addr = LLADDR(sdl); 265 addrlen = sdl->sdl_alen; 266 267 /* get EUI64 */ 268 switch (ifp->if_type) { |
269 case IFT_BRIDGE: |
270 case IFT_ETHER: 271 case IFT_L2VLAN: 272 case IFT_FDDI: 273 case IFT_ISO88025: 274 case IFT_ATM: 275 case IFT_IEEE1394: 276#ifdef IFT_IEEE80211 277 case IFT_IEEE80211: --- 445 unchanged lines hidden (view full) --- 723{ 724 struct in6_ifaddr *ia; 725 struct in6_addr in6; 726 727 /* some of the interfaces are inherently not IPv6 capable */ 728 switch (ifp->if_type) { 729 case IFT_PFLOG: 730 case IFT_PFSYNC: |
731 ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; 732 ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED; |
733 return; 734 } 735 736 /* 737 * quirks based on interface type 738 */ 739 switch (ifp->if_type) { |
740 case IFT_STF: 741 /* 742 * 6to4 interface is a very special kind of beast. 743 * no multicast, no linklocal. RFC2529 specifies how to make 744 * linklocals for 6to4 interface, but there's no use and 745 * it is rather harmful to have one. 746 */ |
747 ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; 748 break; |
749 default: 750 break; 751 } 752 753 /* 754 * usually, we require multicast capability to the interface 755 */ 756 if ((ifp->if_flags & IFF_MULTICAST) == 0) { --- 17 unchanged lines hidden (view full) --- 774 return; 775 } else 776 ifa_free(ifa); 777 } 778 779 /* 780 * assign a link-local address, if there's none. 781 */ |
782 if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && |
783 ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { 784 int error; 785 786 ia = in6ifa_ifpforlinklocal(ifp, 0); 787 if (ia == NULL) { 788 error = in6_ifattach_linklocal(ifp, altifp); 789#if 0 790 if (error) 791 log(LOG_NOTICE, "in6_ifattach_linklocal: " 792 "failed to add a link-local addr to %s\n", 793 if_name(ifp)); 794#endif 795 } else 796 ifa_free(&ia->ia_ifa); 797 } 798 |
799 /* update dynamically. */ 800 if (V_in6_maxmtu < ifp->if_mtu) 801 V_in6_maxmtu = ifp->if_mtu; 802} 803 804/* 805 * NOTE: in6_ifdetach() does not support loopback if at this moment. 806 * We don't need this function in bsdi, because interfaces are never removed --- 183 unchanged lines hidden --- |