diff --git a/route.c b/route.c index 3549e1a..21ff963 100644 --- a/route.c +++ b/route.c @@ -1244,7 +1244,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) */ switch (which) { case RTA_DST: - forcenet++; + nrflags |= F_FORCENET; #if 0 bzero(su, sizeof(*su)); /* for readability */ #endif @@ -1333,7 +1333,7 @@ getaddr(int which, char *str, struct hostent **hpp, int nrflags) } *q = '/'; } - if ((which != RTA_DST || forcenet == 0) && + if ((which != RTA_DST || !(nrflags & F_FORCENET)) && inet_aton(str, &su->sin.sin_addr)) { val = su->sin.sin_addr.s_addr; if (which != RTA_DST || forcehost || ~