summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-12-30 06:18:28 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-12-30 06:18:28 +0000
commit1359258d2efec3daf66d1e863cf8b2d12167c3c1 (patch)
tree92a113f6292614da5a6da9de2684b2860c8c97bf /sbin
parent58b90f7037c614b41bc37165fd10ca8c56f4fcc4 (diff)
Don't do a getnetbyname() if the address is in dot notation already;
solves a DNS-related deadlock. Patch by gluk@ptci.ru (PR 1582)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mountd/mountd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index 4715b3240cb..ed73ccaf0ff 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mountd.c,v 1.32 2000/07/05 23:41:10 deraadt Exp $ */
+/* $OpenBSD: mountd.c,v 1.33 2000/12/30 06:18:27 angelos Exp $ */
/* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */
/*
@@ -1678,14 +1678,10 @@ get_net(cp, net, maskflg)
struct in_addr inetaddr, inetaddr2;
char *name;
- if ((np = getnetbyname(cp)))
- inetaddr = inet_makeaddr(np->n_net, 0);
- else if (isdigit(*cp)) {
- if ((netaddr = inet_network(cp)) == -1)
- return (1);
+ if ((netaddr = inet_network(cp)) != INADDR_NONE) {
inetaddr = inet_makeaddr(netaddr, 0);
/*
- * Due to arbritrary subnet masks, you don't know how many
+ * Due to arbitrary subnet masks, you don't know how many
* bits to shift the address to make it into a network,
* however you do know how to make a network address into
* a host with host == 0 and then compare them.
@@ -1700,8 +1696,12 @@ get_net(cp, net, maskflg)
}
endnetent();
}
- } else
- return (1);
+ } else {
+ if ((np = getnetbyname(cp)))
+ inetaddr = inet_makeaddr(np->n_net, 0);
+ else
+ return (1);
+ }
if (maskflg)
net->nt_mask = inetaddr.s_addr;
else {