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/netinet/in_rmx.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/netinet/in_rmx.c')
-rw-r--r-- | sys/netinet/in_rmx.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index 19cd5fb..8fc60ae 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -251,14 +251,14 @@ static void in_rtqtimo(void *rock) { CURVNET_SET((struct vnet *) rock); - INIT_VNET_NET(curvnet); INIT_VNET_INET(curvnet); int fibnum; void *newrock; struct timeval atv; for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { - if ((newrock = V_rt_tables[fibnum][AF_INET]) != NULL) + newrock = rt_tables_get_rnh(fibnum, AF_INET); + if (newrock != NULL) in_rtqtimo_one(newrock); } atv.tv_usec = 0; @@ -324,10 +324,9 @@ in_rtqdrain(void) VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INIT_VNET_NET(vnet_iter); for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.found = arg.killed = 0; arg.rnh = rnh; arg.nextstop = 0; @@ -423,7 +422,6 @@ in_ifadownkill(struct radix_node *rn, void *xap) int in_ifadown(struct ifaddr *ifa, int delete) { - INIT_VNET_NET(curvnet); struct in_ifadown_arg arg; struct radix_node_head *rnh; int fibnum; @@ -432,7 +430,7 @@ in_ifadown(struct ifaddr *ifa, int delete) return 1; for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - rnh = V_rt_tables[fibnum][AF_INET]; + rnh = rt_tables_get_rnh(fibnum, AF_INET); arg.ifa = ifa; arg.del = delete; RADIX_NODE_HEAD_LOCK(rnh); |