aboutsummaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-07-17 14:15:00 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-07-17 14:15:00 +0000
commit171863ac75f201a260ffca9d75e51c5e6c17b00c (patch)
treef3676aa986289587fe1d58b5c2a0224f543580dd /sbin/route/route.c
parent826b6d6978bd2a396c0f04e1c6bb3ba8166988d0 (diff)
downloadsrc-171863ac75f201a260ffca9d75e51c5e6c17b00c.tar.gz
src-171863ac75f201a260ffca9d75e51c5e6c17b00c.zip
Use NET_RT_DUMP.0.FIB leaf node instead of setting td_proc->p_fibnum.
Notes
Notes: svn path=/head/; revision=253429
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r--sbin/route/route.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 2186482239bb..6e3b25735dd5 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)