Deleted Added
full compact
41c41
< __FBSDID("$FreeBSD: head/usr.bin/netstat/route.c 186119 2008-12-15 06:10:57Z qingli $");
---
> __FBSDID("$FreeBSD: head/usr.bin/netstat/route.c 193232 2009-06-01 15:49:42Z bz $");
125,128c125
< struct rtline {
< struct radix_node_head *tables[AF_MAX+1]; /*xxx*/
< };
< struct rtline *rt_tables;
---
> struct radix_node_head **rt_tables;
130,131d126
< struct radix_node_head *rt_tables_line[1][AF_MAX+1]; /*xxx*/
<
158c153
< struct radix_node_head *rnh, head;
---
> struct radix_node_head **rnhp, *rnh, head;
168c163,164
< rt_tables = calloc(numfibs, sizeof(struct rtline));
---
> rt_tables = calloc(numfibs * (AF_MAX+1),
> sizeof(struct radix_node_head *));
189,190c185,186
< if (kread((u_long)(rtree), (char *)(rt_tables),
< (numfibs * sizeof(struct rtline))) != 0)
---
> if (kread((u_long)(rtree), (char *)(rt_tables), (numfibs *
> (AF_MAX+1) * sizeof(struct radix_node_head *))) != 0)
198c194,198
< if ((rnh = rt_tables[tmpfib].tables[i]) == 0)
---
> rnhp = (struct radix_node_head **)*rt_tables;
> /* Calculate the in-kernel address. */
> rnhp += tmpfib * (AF_MAX+1) + i;
> /* Read the in kernel rhn pointer. */
> if (kget(rnhp, rnh) != 0)
199a200,202
> if (rnh == NULL)
> continue;
> /* Read the rnh data. */