Deleted Added
full compact
in6_ifattach.c (250251) in6_ifattach.c (252511)
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>
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 $");
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) {
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:
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:
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;
730 return;
731 }
732
733 /*
734 * quirks based on interface type
735 */
736 switch (ifp->if_type) {
733 return;
734 }
735
736 /*
737 * quirks based on interface type
738 */
739 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 */
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 */
745 goto statinit;
746#endif
747 ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL;
748 break;
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 */
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 */
780 if (ifp->if_type != IFT_BRIDGE &&
781 !(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
782 if (!(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
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
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 ---
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 ---