diff options
author | hrs <hrs@FreeBSD.org> | 2013-07-17 14:15:00 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-07-17 14:15:00 +0000 |
commit | 96df60d2ef9ce30d58326c976f08e66c0c066c01 (patch) | |
tree | f3676aa986289587fe1d58b5c2a0224f543580dd /sbin | |
parent | 9542c4065e347b47bdfeee6635ab0598e64bab9d (diff) | |
download | FreeBSD-src-96df60d2ef9ce30d58326c976f08e66c0c066c01.zip FreeBSD-src-96df60d2ef9ce30d58326c976f08e66c0c066c01.tar.gz |
Use NET_RT_DUMP.0.FIB leaf node instead of setting td_proc->p_fibnum.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/route/route.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 2186482..6e3b257 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -118,7 +118,6 @@ static const char *routename(struct sockaddr *); static int rtmsg(int, int, int); static void set_metric(char *, int); static int set_sofib(int); -static int set_procfib(int); static void sockaddr(char *, struct sockaddr *, size_t); static void sodump(struct sockaddr *, const char *); extern char *iso_ntoa(void); @@ -236,15 +235,6 @@ set_sofib(int fib) } static int -set_procfib(int fib) -{ - - if (fib < 0) - return (0); - return (setfib(fib)); -} - -static int fiboptlist_range(const char *arg, struct fibl_head_t *flh) { struct fibl *fl; @@ -420,11 +410,10 @@ flushroutes_fib(int fib) struct rt_msghdr *rtm; size_t needed; char *buf, *next, *lim; - int mib[6], rlen, seqno, count = 0; + int mib[7], rlen, seqno, count = 0; int error; error = set_sofib(fib); - error += set_procfib(fib); if (error) { warn("fib number %d is ignored", fib); return (error); @@ -437,6 +426,7 @@ retry: mib[3] = AF_UNSPEC; mib[4] = NET_RT_DUMP; mib[5] = 0; /* no flags */ + mib[6] = fib; if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) |