summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1996-02-17 21:13:32 +0000
committermpp <mpp@FreeBSD.org>1996-02-17 21:13:32 +0000
commit2e7d5162dae097220859d4fd206c0979d50da2df (patch)
treeaae293e705ced812c4b57167308e41364dd80536 /sbin/route
parent8b115c5fc51ae95cdef8f4bf8747a4ee347850ad (diff)
downloadFreeBSD-src-2e7d5162dae097220859d4fd206c0979d50da2df.zip
FreeBSD-src-2e7d5162dae097220859d4fd206c0979d50da2df.tar.gz
Fix route to check if inet_addr and inet_network return INADDR_NONE,
instead of -1 which is never returned by those routines.
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 5b285f9..c2ae5ed 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
*/
static const char rcsid[] =
- "$Id: route.c,v 1.5 1996/02/06 20:36:10 wollman Exp $";
+ "$Id: route.c,v 1.6 1996/02/13 17:30:34 wollman Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -890,7 +890,7 @@ getaddr(which, s, hpp)
if (hpp == NULL)
hpp = &hp;
*hpp = NULL;
- if (((val = inet_addr(s)) != -1) &&
+ if (((val = inet_addr(s)) != INADDR_NONE) &&
(which != RTA_DST || forcenet == 0)) {
su->sin.sin_addr.s_addr = val;
if (inet_lnaof(su->sin.sin_addr) != INADDR_ANY)
@@ -900,7 +900,7 @@ getaddr(which, s, hpp)
goto netdone;
}
}
- if ((val = inet_network(s)) != -1 ||
+ if ((val = inet_network(s)) != INADDR_NONE ||
((np = getnetbyname(s)) != NULL && (val = np->n_net) != 0)) {
netdone:
if (which == RTA_DST)
OpenPOWER on IntegriCloud