From 2e32d69db105b61142a0b7df180b8b98edae739c Mon Sep 17 00:00:00 2001 From: Mike Pritchard Date: Sat, 17 Feb 1996 21:13:32 +0000 Subject: [PATCH] Fix route to check if inet_addr and inet_network return INADDR_NONE, instead of -1 which is never returned by those routines. --- sbin/route/route.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index 5b285f9b3e21..c2ae5ede384c 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 @@ -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)