summaryrefslogtreecommitdiffstats
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 5ea93d3..9511035 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -182,6 +182,7 @@ rts_attach(struct socket *so, int proto, struct thread *td)
*/
s = splnet();
so->so_pcb = (caddr_t)rp;
+ so->so_fibnum = td->td_proc->p_fibnum;
error = raw_attach(so, proto);
rp = sotorawcb(so);
if (error) {
@@ -387,7 +388,8 @@ route_output(struct mbuf *m, struct socket *so)
if (info.rti_info[RTAX_GATEWAY] == NULL)
senderr(EINVAL);
saved_nrt = NULL;
- error = rtrequest1(RTM_ADD, &info, &saved_nrt);
+ error = rtrequest1_fib(RTM_ADD, &info, &saved_nrt,
+ so->so_fibnum);
if (error == 0 && saved_nrt) {
RT_LOCK(saved_nrt);
rt_setmetrics(rtm->rtm_inits,
@@ -401,7 +403,8 @@ route_output(struct mbuf *m, struct socket *so)
case RTM_DELETE:
saved_nrt = NULL;
- error = rtrequest1(RTM_DELETE, &info, &saved_nrt);
+ error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt,
+ so->so_fibnum);
if (error == 0) {
RT_LOCK(saved_nrt);
rt = saved_nrt;
@@ -412,7 +415,7 @@ route_output(struct mbuf *m, struct socket *so)
case RTM_GET:
case RTM_CHANGE:
case RTM_LOCK:
- rnh = rt_tables[info.rti_info[RTAX_DST]->sa_family];
+ rnh = rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family];
if (rnh == NULL)
senderr(EAFNOSUPPORT);
RADIX_NODE_HEAD_LOCK(rnh);
@@ -530,7 +533,8 @@ route_output(struct mbuf *m, struct socket *so)
!sa_equal(info.rti_info[RTAX_IFA],
rt->rt_ifa->ifa_addr))) {
RT_UNLOCK(rt);
- if ((error = rt_getifa(&info)) != 0)
+ if ((error = rt_getifa_fib(&info,
+ rt->rt_fibnum)) != 0)
senderr(error);
RT_LOCK(rt);
}
@@ -1278,7 +1282,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
} else /* dump only one table */
i = lim = af;
for (error = 0; error == 0 && i <= lim; i++)
- if ((rnh = rt_tables[i]) != NULL) {
+ if ((rnh = rt_tables[curthread->td_proc->p_fibnum][i]) != NULL) {
RADIX_NODE_HEAD_LOCK(rnh);
error = rnh->rnh_walktree(rnh,
sysctl_dumpentry, &w);
OpenPOWER on IntegriCloud