Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6.c
Show First 20 Lines • Show All 1,603 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Find a link-local scoped address on ifp and return it if any. | * Find a link-local scoped address on ifp and return it if any. | ||||
*/ | */ | ||||
struct in6_ifaddr * | struct in6_ifaddr * | ||||
in6ifa_llaonifp(struct ifnet *ifp) | in6ifa_llaonifp(struct ifnet *ifp) | ||||
{ | { | ||||
struct epoch_tracker et; | struct epoch_tracker et; | ||||
struct sockaddr_in6 *sin6; | struct sockaddr_in6 *sin6; | ||||
struct nd_ifinfo *ndi; | |||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) | if ((ndi = nd6_ifinfo(ifp)) != NULL && | ||||
(ndi->flags & ND6_IFF_IFDISABLED) != 0) | |||||
return (NULL); | return (NULL); | ||||
NET_EPOCH_ENTER(et); | NET_EPOCH_ENTER(et); | ||||
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | ||||
if (ifa->ifa_addr->sa_family != AF_INET6) | if (ifa->ifa_addr->sa_family != AF_INET6) | ||||
continue; | continue; | ||||
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; | sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; | ||||
if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) || | if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) || | ||||
IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr) || | IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr) || | ||||
▲ Show 20 Lines • Show All 365 Lines • ▼ Show 20 Lines | in6_if_up(struct ifnet *ifp) | ||||
* special cases, like 6to4, are handled in in6_ifattach | * special cases, like 6to4, are handled in in6_ifattach | ||||
*/ | */ | ||||
in6_ifattach(ifp, NULL); | in6_ifattach(ifp, NULL); | ||||
} | } | ||||
int | int | ||||
in6if_do_dad(struct ifnet *ifp) | in6if_do_dad(struct ifnet *ifp) | ||||
{ | { | ||||
struct nd_ifinfo *ndi; | |||||
if ((ifp->if_flags & IFF_LOOPBACK) != 0) | if ((ifp->if_flags & IFF_LOOPBACK) != 0) | ||||
return (0); | return (0); | ||||
if ((ifp->if_flags & IFF_MULTICAST) == 0) | if ((ifp->if_flags & IFF_MULTICAST) == 0) | ||||
return (0); | return (0); | ||||
if ((ND_IFINFO(ifp)->flags & | if ((ndi = nd6_ifinfo(ifp)) == NULL || | ||||
(ND6_IFF_IFDISABLED | ND6_IFF_NO_DAD)) != 0) | (ndi->flags & (ND6_IFF_IFDISABLED | ND6_IFF_NO_DAD)) != 0) | ||||
return (0); | return (0); | ||||
return (1); | return (1); | ||||
} | } | ||||
/* | /* | ||||
* Calculate max IPv6 MTU through all the interfaces and store it | * Calculate max IPv6 MTU through all the interfaces and store it | ||||
* to in6_maxmtu. | * to in6_maxmtu. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 574 Lines • Show Last 20 Lines |