From d189b0dfd03c7b8f1ca08b8f762418be013ad7c0 Mon Sep 17 00:00:00 2001 From: pst Date: Wed, 30 Apr 1997 18:40:12 +0000 Subject: Back out msmith's recent commit which breaks using symbolic names for netmasks. Instead, reverse the order of the testing, so if a symbolic name starts with a digit, we'll see if we can make a network address out of it first. If that fails, then we'll call getnet... --- usr.sbin/mountd/mountd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'usr.sbin/mountd') 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 @@ -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 { -- cgit v1.1