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...
This commit is contained in:
parent
68962748a6
commit
d189b0dfd0
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user