summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1997-10-17 04:59:56 +0000
committerjdp <jdp@FreeBSD.org>1997-10-17 04:59:56 +0000
commit7484bbe28efc698bd11fed0c0cb65dc95438ecec (patch)
tree645f848255c9e67061f7602fea2d62a6fbc2d456 /lib/libc/rpc
parent27e81f68587ca2cee5db3913a5b6426b031bc648 (diff)
downloadFreeBSD-src-7484bbe28efc698bd11fed0c0cb65dc95438ecec.zip
FreeBSD-src-7484bbe28efc698bd11fed0c0cb65dc95438ecec.tar.gz
Fix two bugs which caused various RPC programs (mountd, nfsd, ...)
to fail under certain circumstances. 1. In one spot, the ifr_flags member was being examined in the wrong structure, thus it contained garbage. On a machine in which only the loopback interface was up, this caused everything that wanted to talk to the portmapper to fail -- a particular problem with laptops, where the pccard ethernet interface is likely to come up long after the attempt to start mountd, nfsd, amd, etc. 2. Compounding the above problem, get_myaddress() returned a successful status even though it failed to find an address that it considered good enough.
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/get_myaddress.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index b2ec397..f4ba48b 100644
--- a/lib/libc/rpc/get_myaddress.c
+++ b/lib/libc/rpc/get_myaddress.c
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)get_myaddress.c 2.1 88/07/29 4.0 RPCSRC";*/
-static char *rcsid = "$Id: get_myaddress.c,v 1.12 1997/06/20 17:54:11 wpaul Exp $";
+static char *rcsid = "$Id: get_myaddress.c,v 1.13 1997/09/21 23:04:51 wpaul Exp $";
#endif
/*
@@ -91,7 +91,7 @@ again:
!(ifreq.ifr_flags & IFF_LOOPBACK)) ||
(loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK)
&& (ifr->ifr_addr.sa_family == AF_INET)
- && (ifr->ifr_flags & IFF_UP))) {
+ && (ifreq.ifr_flags & IFF_UP))) {
*addr = *((struct sockaddr_in *)&ifr->ifr_addr);
addr->sin_port = htons(PMAPPORT);
gotit = 1;
@@ -108,5 +108,5 @@ again:
goto again;
}
(void) close(s);
- return (0);
+ return (gotit ? 0 : -1);
}
OpenPOWER on IntegriCloud