Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6.c
Show First 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { | ||||
log(LOG_NOTICE, "SIOCAIFADDR_IN6: " | log(LOG_NOTICE, "SIOCAIFADDR_IN6: " | ||||
"SIOCSIFINFO_FLAGS for -ifdisabled " | "SIOCSIFINFO_FLAGS for -ifdisabled " | ||||
"failed."); | "failed."); | ||||
/* | /* | ||||
* Ignore failure of clearing the flag intentionally. | * Ignore failure of clearing the flag intentionally. | ||||
* The failure means address duplication was detected. | * The failure means address duplication was detected. | ||||
*/ | */ | ||||
} | } | ||||
EVENTHANDLER_INVOKE(ifaddr_event, ifp); | |||||
break; | break; | ||||
} | } | ||||
case SIOCDIFADDR_IN6: | case SIOCDIFADDR_IN6: | ||||
{ | { | ||||
struct nd_prefix *pr; | struct nd_prefix *pr; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 696 Lines • ▼ Show 20 Lines | TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | ||||
ifacount++; | ifacount++; | ||||
} | } | ||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
} | } | ||||
if (ifacount <= 1 && ifp->if_ioctl) { | if (ifacount <= 1 && ifp->if_ioctl) { | ||||
error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); | error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); | ||||
if (error) | if (error) | ||||
return (error); | goto done; | ||||
} | } | ||||
/* | /* | ||||
* If a new destination address is specified, scrub the old one and | * If a new destination address is specified, scrub the old one and | ||||
* install the new destination. Note that the interface must be | * install the new destination. Note that the interface must be | ||||
* p2p or loopback. | * p2p or loopback. | ||||
*/ | */ | ||||
pdst = &ifra->ifra_dstaddr; | pdst = &ifra->ifra_dstaddr; | ||||
Show All 23 Lines | if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 && | ||||
int rtflags = RTF_UP | RTF_HOST; | int rtflags = RTF_UP | RTF_HOST; | ||||
/* | /* | ||||
* Handle the case for ::1 . | * Handle the case for ::1 . | ||||
*/ | */ | ||||
if (ifp->if_flags & IFF_LOOPBACK) | if (ifp->if_flags & IFF_LOOPBACK) | ||||
ia->ia_flags |= IFA_RTSELF; | ia->ia_flags |= IFA_RTSELF; | ||||
error = rtinit(&ia->ia_ifa, RTM_ADD, ia->ia_flags | rtflags); | error = rtinit(&ia->ia_ifa, RTM_ADD, ia->ia_flags | rtflags); | ||||
if (error) | if (error) | ||||
return (error); | goto done; | ||||
ia->ia_flags |= IFA_ROUTE; | ia->ia_flags |= IFA_ROUTE; | ||||
} | } | ||||
/* | /* | ||||
* add a loopback route to self if not exists | * add a loopback route to self if not exists | ||||
*/ | */ | ||||
if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) { | if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) { | ||||
error = ifa_add_loopback_route((struct ifaddr *)ia, | error = ifa_add_loopback_route((struct ifaddr *)ia, | ||||
(struct sockaddr *)&ia->ia_addr); | (struct sockaddr *)&ia->ia_addr); | ||||
if (error == 0) | if (error == 0) | ||||
ia->ia_flags |= IFA_RTSELF; | ia->ia_flags |= IFA_RTSELF; | ||||
} | } | ||||
done: | |||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | |||||
"Invoking IPv6 network device address event may sleep"); | |||||
EVENTHANDLER_INVOKE(ifaddr_event, ifp); | |||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Find an IPv6 interface link-local address specific to an interface. | * Find an IPv6 interface link-local address specific to an interface. | ||||
* ifaddr is returned referenced. | * ifaddr is returned referenced. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,089 Lines • Show Last 20 Lines |