diff options
-rw-r--r-- | sbin/mountd/mountd.c | 11 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.c | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 10c43a1..b670303 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -43,7 +43,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ static const char rcsid[] = - "$Id: mountd.c,v 1.19 1997/04/22 10:37:27 dfr Exp $"; + "$Id: mountd.c,v 1.20 1997/04/23 11:03:10 msmith Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -1707,11 +1707,7 @@ get_net(cp, net, maskflg) struct in_addr inetaddr, inetaddr2; char *name; - if (!maskflg && (np = getnetbyname(cp))) - inetaddr = inet_makeaddr(np->n_net, 0); - else if (isdigit(*cp)) { - if ((netaddr = inet_network(cp)) == -1) - return (1); + if (isdigit(*cp) && ((netaddr = inet_network(cp)) != -1)) { inetaddr = inet_makeaddr(netaddr, 0); /* * Due to arbritrary subnet masks, you don't know how many @@ -1729,8 +1725,11 @@ get_net(cp, net, maskflg) } endnetent(); } + } else if ((np = getnetbyname(cp)) != NULL) { + inetaddr = inet_makeaddr(np->n_net, 0); } else return (1); + if (maskflg) net->nt_mask = inetaddr.s_addr; else { diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 10c43a1..b670303 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -43,7 +43,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ static const char rcsid[] = - "$Id: mountd.c,v 1.19 1997/04/22 10:37:27 dfr Exp $"; + "$Id: mountd.c,v 1.20 1997/04/23 11:03:10 msmith Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -1707,11 +1707,7 @@ get_net(cp, net, maskflg) struct in_addr inetaddr, inetaddr2; char *name; - if (!maskflg && (np = getnetbyname(cp))) - inetaddr = inet_makeaddr(np->n_net, 0); - else if (isdigit(*cp)) { - if ((netaddr = inet_network(cp)) == -1) - return (1); + if (isdigit(*cp) && ((netaddr = inet_network(cp)) != -1)) { inetaddr = inet_makeaddr(netaddr, 0); /* * Due to arbritrary subnet masks, you don't know how many @@ -1729,8 +1725,11 @@ get_net(cp, net, maskflg) } endnetent(); } + } else if ((np = getnetbyname(cp)) != NULL) { + inetaddr = inet_makeaddr(np->n_net, 0); } else return (1); + if (maskflg) net->nt_mask = inetaddr.s_addr; else { |