diff options
author | bz <bz@FreeBSD.org> | 2009-06-01 15:49:42 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-06-01 15:49:42 +0000 |
commit | c62e99f85d6b43e872928cb1f83b13335b7b5d51 (patch) | |
tree | 743a83cdd0c6416f952293952e112bd315518157 /sys/net/rtsock.c | |
parent | c731979fffc05b5f4ec31fd935fe3bed200a0b42 (diff) | |
download | FreeBSD-src-c62e99f85d6b43e872928cb1f83b13335b7b5d51.zip FreeBSD-src-c62e99f85d6b43e872928cb1f83b13335b7b5d51.tar.gz |
Convert the two dimensional array to be malloced and introduce
an accessor function to get the correct rnh pointer back.
Update netstat to get the correct pointer using kvm_read()
as well.
This not only fixes the ABI problem depending on the kernel
option but also permits the tunable to overwrite the kernel
option at boot time up to MAXFIBS, enlarging the number of
FIBs without having to recompile. So people could just use
GENERIC now.
Reviewed by: julian, rwatson, zec
X-MFC: not possible
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index c9f76af..751e0ae 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -460,7 +460,6 @@ static int route_output(struct mbuf *m, struct socket *so) { #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) - INIT_VNET_NET(so->so_vnet); struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct radix_node_head *rnh; @@ -561,7 +560,8 @@ route_output(struct mbuf *m, struct socket *so) case RTM_GET: case RTM_CHANGE: case RTM_LOCK: - rnh = V_rt_tables[so->so_fibnum][info.rti_info[RTAX_DST]->sa_family]; + rnh = rt_tables_get_rnh(so->so_fibnum, + info.rti_info[RTAX_DST]->sa_family); if (rnh == NULL) senderr(EAFNOSUPPORT); RADIX_NODE_HEAD_RLOCK(rnh); @@ -1418,10 +1418,9 @@ done: static int sysctl_rtsock(SYSCTL_HANDLER_ARGS) { - INIT_VNET_NET(curvnet); int *name = (int *)arg1; u_int namelen = arg2; - struct radix_node_head *rnh; + struct radix_node_head *rnh = NULL; /* silence compiler. */ int i, lim, error = EINVAL; u_char af; struct walkarg w; @@ -1469,7 +1468,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) * take care of routing entries */ for (error = 0; error == 0 && i <= lim; i++) - if ((rnh = V_rt_tables[req->td->td_proc->p_fibnum][i]) != NULL) { + rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i); + if (rnh != NULL) { RADIX_NODE_HEAD_LOCK(rnh); error = rnh->rnh_walktree(rnh, sysctl_dumpentry, &w); |