summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2014-04-16 12:29:45 +0000
committerbz <bz@FreeBSD.org>2014-04-16 12:29:45 +0000
commit5745e3fab37f993b2aa603ad7b16c5c7393fbfdf (patch)
tree313602062004cf28fd5846688cec54c22f1e36ab /sbin/route
parent8ec9c75ecb2046592012bc555e774421978f4110 (diff)
downloadFreeBSD-src-5745e3fab37f993b2aa603ad7b16c5c7393fbfdf.zip
FreeBSD-src-5745e3fab37f993b2aa603ad7b16c5c7393fbfdf.tar.gz
When switching variables to flags in r243185 a few cases were missed.
After r263152 this leaves unused variables if route(8) is compiled without INET support. Switch the remaining variable accesses to flags and remove now obsolete variables. Reviewed by: glebius MFC after: 1 week
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index f22d9d2..794f143 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -90,7 +90,7 @@ static struct keytab {
static struct sockaddr_storage so[RTAX_MAX];
static int pid, rtm_addrs;
static int s;
-static int forcehost, forcenet, nflag, af, qflag, tflag;
+static int nflag, af, qflag, tflag;
static int verbose, aflen;
static int locking, lockrest, debugonly;
static struct rt_metrics rt_metrics;
@@ -1245,7 +1245,7 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
*/
switch (idx) {
case RTAX_DST:
- forcenet++;
+ nrflags |= F_FORCENET;
getaddr(RTAX_NETMASK, str, 0, nrflags);
break;
}
@@ -1308,10 +1308,10 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
}
*q = '/';
}
- if ((idx != RTAX_DST || forcenet == 0) &&
+ if ((idx != RTAX_DST || (nrflags & F_FORCENET) == 0) &&
inet_aton(str, &sin->sin_addr)) {
val = sin->sin_addr.s_addr;
- if (idx != RTAX_DST || forcehost ||
+ if (idx != RTAX_DST || nrflags & F_FORCEHOST ||
inet_lnaof(sin->sin_addr) != INADDR_ANY)
return (1);
else {
@@ -1319,7 +1319,7 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags)
goto netdone;
}
}
- if (idx == RTAX_DST && forcehost == 0 &&
+ if (idx == RTAX_DST && (nrflags & F_FORCEHOST) == 0 &&
((val = inet_network(str)) != INADDR_NONE ||
((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) {
netdone:
OpenPOWER on IntegriCloud