diff options
author | bz <bz@FreeBSD.org> | 2014-08-16 13:47:04 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2014-08-16 13:47:04 +0000 |
commit | a771dfd28a60ce30bfffc98d3cf898c9b97ec08c (patch) | |
tree | f9bcedc8d391b3cd99a6af3207404a0f2d8d924b | |
parent | 4e0609eb851ad23d1af64d386fcb0f7728793c29 (diff) | |
download | FreeBSD-src-a771dfd28a60ce30bfffc98d3cf898c9b97ec08c.zip FreeBSD-src-a771dfd28a60ce30bfffc98d3cf898c9b97ec08c.tar.gz |
MFC r264539:
When switching variables to flags in r243185 a few cases were missed.
After r263152 (in head) 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
-rw-r--r-- | sbin/route/route.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 35deba5..abc5508 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -81,7 +81,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; @@ -1235,7 +1235,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; } @@ -1275,7 +1275,7 @@ getaddr(int idx, char *str, struct hostent **hpp, int nrflags) if (!atalk_aton(str, &sat->sat_addr)) errx(EX_NOHOST, "bad address: %s", str); rtm_addrs |= RTA_NETMASK; - return(forcehost || sat->sat_addr.s_node != 0); + return(nrflags & F_FORCEHOST || sat->sat_addr.s_node != 0); } case AF_LINK: link_addr(str, (struct sockaddr_dl *)(void *)sa); @@ -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: |