summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2014-06-06 21:45:14 +0000
committerasomers <asomers@FreeBSD.org>2014-06-06 21:45:14 +0000
commit322a1ee4a01630c2c5cb0ecfd4cb5b7aabe46793 (patch)
tree14298f8dc6491de3d34d500b9b3f6e24bfc4b814 /sys/net
parenta8aa481895641687bc168b6283d7521e52a48280 (diff)
downloadFreeBSD-src-322a1ee4a01630c2c5cb0ecfd4cb5b7aabe46793.zip
FreeBSD-src-322a1ee4a01630c2c5cb0ecfd4cb5b7aabe46793.tar.gz
MFC r264887
Fix host and network routes for new interfaces when net.add_addr_allfibs=0 sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/route.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 908804d..39bcb38 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1458,7 +1458,7 @@ ifa_add_loopback_route(struct ifaddr *ifa, struct sockaddr *ia)
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC;
info.rti_info[RTAX_DST] = ia;
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl;
- error = rtrequest1_fib(RTM_ADD, &info, &rt, 0);
+ error = rtrequest1_fib(RTM_ADD, &info, &rt, ifa->ifa_ifp->if_fib);
if (error == 0 && rt != NULL) {
RT_LOCK(rt);
@@ -1490,7 +1490,7 @@ ifa_del_loopback_route(struct ifaddr *ifa, struct sockaddr *ia)
info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC;
info.rti_info[RTAX_DST] = ia;
info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl;
- error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0);
+ error = rtrequest1_fib(RTM_DELETE, &info, NULL, ifa->ifa_ifp->if_fib);
if (error != 0)
log(LOG_DEBUG, "%s: deletion failed: %u\n", __func__, error);
diff --git a/sys/net/route.c b/sys/net/route.c
index dfad778..4182c85 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1543,7 +1543,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum)
}
if (fibnum == RT_ALL_FIBS) {
if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) {
- startfib = endfib = curthread->td_proc->p_fibnum;
+ startfib = endfib = ifa->ifa_ifp->if_fib;
} else {
startfib = 0;
endfib = rt_numfibs - 1;
OpenPOWER on IntegriCloud