Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if.c
Context not available. | |||||
ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, | ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, | ||||
struct sockaddr *ia) | struct sockaddr *ia) | ||||
{ | { | ||||
int error; | int error; | ||||
struct rt_addrinfo info; | struct rt_addrinfo info; | ||||
struct sockaddr_dl null_sdl; | struct sockaddr_dl null_sdl; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
ifp = ifa->ifa_ifp; | ifp = ifa->ifa_ifp; | ||||
bzero(&info, sizeof(info)); | bzero(&info, sizeof(info)); | ||||
if (cmd != RTM_DELETE) | if (cmd != RTM_DELETE) | ||||
info.rti_ifp = V_loif; | info.rti_ifp = V_loif; | ||||
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; | info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; | ||||
info.rti_info[RTAX_DST] = ia; | info.rti_info[RTAX_DST] = ia; | ||||
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; | info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; | ||||
link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); | link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); | ||||
error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); | error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); | ||||
if (error != 0) | if (error != 0) | ||||
log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", | log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", | ||||
__func__, otype, if_name(ifp), error); | __func__, otype, if_name(ifp), error); | ||||
return (error); | return (error); | ||||
} | } | ||||
Context not available. |