Lines 1908-1913
ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa,
Link Here
|
1908 |
struct sockaddr *ia) |
1908 |
struct sockaddr *ia) |
1909 |
{ |
1909 |
{ |
1910 |
int error; |
1910 |
int error; |
|
|
1911 |
int fibnum; |
1911 |
struct rt_addrinfo info; |
1912 |
struct rt_addrinfo info; |
1912 |
struct sockaddr_dl null_sdl; |
1913 |
struct sockaddr_dl null_sdl; |
1913 |
struct ifnet *ifp; |
1914 |
struct ifnet *ifp; |
Lines 1922-1927
ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa,
Link Here
|
1922 |
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; |
1923 |
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; |
1923 |
link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); |
1924 |
link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); |
1924 |
|
1925 |
|
|
|
1926 |
// XXX: prevent dangling loopback route in other fibs |
1927 |
if (cmd == RTM_DELETE) { |
1928 |
for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { |
1929 |
if (fibnum == ifp->if_fib) |
1930 |
continue; |
1931 |
|
1932 |
(void) rtrequest1_fib(cmd, &info, NULL, fibnum); |
1933 |
} |
1934 |
} |
1935 |
|
1925 |
error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); |
1936 |
error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); |
1926 |
|
1937 |
|
1927 |
if (error == 0 || |
1938 |
if (error == 0 || |