|
Lines 1698-1724
static int
Link Here
|
| 1698 |
ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, |
1698 |
ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa, |
| 1699 |
struct sockaddr *ia) |
1699 |
struct sockaddr *ia) |
| 1700 |
{ |
1700 |
{ |
| 1701 |
int error; |
1701 |
int error; |
| 1702 |
struct rt_addrinfo info; |
1702 |
struct rt_addrinfo info; |
| 1703 |
struct sockaddr_dl null_sdl; |
1703 |
struct sockaddr_dl null_sdl; |
| 1704 |
struct ifnet *ifp; |
1704 |
struct ifnet *ifp; |
| 1705 |
|
1705 |
|
| 1706 |
ifp = ifa->ifa_ifp; |
1706 |
ifp = ifa->ifa_ifp; |
| 1707 |
|
1707 |
|
| 1708 |
bzero(&info, sizeof(info)); |
1708 |
bzero(&info, sizeof(info)); |
| 1709 |
if (cmd != RTM_DELETE) |
1709 |
if (cmd != RTM_DELETE) |
| 1710 |
info.rti_ifp = V_loif; |
1710 |
info.rti_ifp = V_loif; |
| 1711 |
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; |
1711 |
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; |
| 1712 |
info.rti_info[RTAX_DST] = ia; |
1712 |
info.rti_info[RTAX_DST] = ia; |
| 1713 |
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; |
1713 |
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; |
| 1714 |
link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); |
1714 |
link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); |
| 1715 |
|
1715 |
|
| 1716 |
error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); |
1716 |
error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); |
| 1717 |
|
1717 |
|
| 1718 |
if (error != 0) |
1718 |
if (error != 0) |
| 1719 |
log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", |
1719 |
log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", |
| 1720 |
__func__, otype, if_name(ifp), error); |
1720 |
__func__, otype, if_name(ifp), error); |
| 1721 |
|
1721 |
|
| 1722 |
return (error); |
1722 |
return (error); |
| 1723 |
} |
1723 |
} |
| 1724 |
|
1724 |
|