Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/nd6.c
Show First 20 Lines • Show All 1,559 Lines • ▼ Show 20 Lines | |||||
* Rejuvenate this function for routing operations related | * Rejuvenate this function for routing operations related | ||||
* processing. | * processing. | ||||
*/ | */ | ||||
void | void | ||||
nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) | nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) | ||||
{ | { | ||||
struct sockaddr_in6 *gateway; | struct sockaddr_in6 *gateway; | ||||
struct nd_defrouter *dr; | struct nd_defrouter *dr; | ||||
struct ifnet *ifp; | struct nhop_object *nh; | ||||
gateway = (struct sockaddr_in6 *)rt->rt_gateway; | nh = rt->rt_nhop; | ||||
ifp = rt->rt_ifp; | gateway = &nh->gw6_sa; | ||||
switch (req) { | switch (req) { | ||||
case RTM_ADD: | case RTM_ADD: | ||||
break; | break; | ||||
case RTM_DELETE: | case RTM_DELETE: | ||||
if (!ifp) | |||||
return; | |||||
/* | /* | ||||
* Only indirect routes are interesting. | * Only indirect routes are interesting. | ||||
*/ | */ | ||||
if ((rt->rt_flags & RTF_GATEWAY) == 0) | if ((nh->nh_flags & NHF_GATEWAY) == 0) | ||||
return; | return; | ||||
/* | /* | ||||
* check for default route | * check for default route | ||||
*/ | */ | ||||
if (IN6_ARE_ADDR_EQUAL(&in6addr_any, | if (nh->nh_flags & NHF_DEFAULT) { | ||||
&SIN6(rt_key(rt))->sin6_addr)) { | dr = defrouter_lookup(&gateway->sin6_addr, nh->nh_ifp); | ||||
dr = defrouter_lookup(&gateway->sin6_addr, ifp); | |||||
if (dr != NULL) { | if (dr != NULL) { | ||||
dr->installed = 0; | dr->installed = 0; | ||||
defrouter_rele(dr); | defrouter_rele(dr); | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,060 Lines • Show Last 20 Lines |