Deleted Added
sdiff udiff text old ( 250251 ) new ( 252511 )
full compact
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 250251 2013-05-04 19:16:26Z 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_ETHER:
270 case IFT_L2VLAN:
271 case IFT_FDDI:
272 case IFT_ISO88025:
273 case IFT_ATM:
274 case IFT_IEEE1394:
275#ifdef IFT_IEEE80211
276 case IFT_IEEE80211:

--- 445 unchanged lines hidden (view full) ---

722{
723 struct in6_ifaddr *ia;
724 struct in6_addr in6;
725
726 /* some of the interfaces are inherently not IPv6 capable */
727 switch (ifp->if_type) {
728 case IFT_PFLOG:
729 case IFT_PFSYNC:
730 return;
731 }
732
733 /*
734 * quirks based on interface type
735 */
736 switch (ifp->if_type) {
737#ifdef IFT_STF
738 case IFT_STF:
739 /*
740 * 6to4 interface is a very special kind of beast.
741 * no multicast, no linklocal. RFC2529 specifies how to make
742 * linklocals for 6to4 interface, but there's no use and
743 * it is rather harmful to have one.
744 */
745 goto statinit;
746#endif
747 default:
748 break;
749 }
750
751 /*
752 * usually, we require multicast capability to the interface
753 */
754 if ((ifp->if_flags & IFF_MULTICAST) == 0) {

--- 17 unchanged lines hidden (view full) ---

772 return;
773 } else
774 ifa_free(ifa);
775 }
776
777 /*
778 * assign a link-local address, if there's none.
779 */
780 if (ifp->if_type != IFT_BRIDGE &&
781 !(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
782 ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) {
783 int error;
784
785 ia = in6ifa_ifpforlinklocal(ifp, 0);
786 if (ia == NULL) {
787 error = in6_ifattach_linklocal(ifp, altifp);
788#if 0
789 if (error)
790 log(LOG_NOTICE, "in6_ifattach_linklocal: "
791 "failed to add a link-local addr to %s\n",
792 if_name(ifp));
793#endif
794 } else
795 ifa_free(&ia->ia_ifa);
796 }
797
798#ifdef IFT_STF /* XXX */
799statinit:
800#endif
801
802 /* update dynamically. */
803 if (V_in6_maxmtu < ifp->if_mtu)
804 V_in6_maxmtu = ifp->if_mtu;
805}
806
807/*
808 * NOTE: in6_ifdetach() does not support loopback if at this moment.
809 * We don't need this function in bsdi, because interfaces are never removed

--- 183 unchanged lines hidden ---