Don't call getnetbyname() on a netmask. On a system with a slow net

connection, a large set of network exports could take many minutes to
time out, giving the appearance of a total hang during boot.
This commit is contained in:
Mike Smith 1997-04-23 11:03:10 +00:00
parent 3d56ef8c48
commit 590ef650e0
2 changed files with 4 additions and 4 deletions

View File

@ -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.18 1997/04/09 20:17:15 guido Exp $";
"$Id: mountd.c,v 1.19 1997/04/22 10:37:27 dfr Exp $";
#endif /*not lint*/
#include <sys/param.h>
@ -1707,7 +1707,7 @@ get_net(cp, net, maskflg)
struct in_addr inetaddr, inetaddr2;
char *name;
if (np = getnetbyname(cp))
if (!maskflg && (np = getnetbyname(cp)))
inetaddr = inet_makeaddr(np->n_net, 0);
else if (isdigit(*cp)) {
if ((netaddr = inet_network(cp)) == -1)

View File

@ -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.18 1997/04/09 20:17:15 guido Exp $";
"$Id: mountd.c,v 1.19 1997/04/22 10:37:27 dfr Exp $";
#endif /*not lint*/
#include <sys/param.h>
@ -1707,7 +1707,7 @@ get_net(cp, net, maskflg)
struct in_addr inetaddr, inetaddr2;
char *name;
if (np = getnetbyname(cp))
if (!maskflg && (np = getnetbyname(cp)))
inetaddr = inet_makeaddr(np->n_net, 0);
else if (isdigit(*cp)) {
if ((netaddr = inet_network(cp)) == -1)