summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1997-09-21 23:04:51 +0000
committerBill Paul <wpaul@FreeBSD.org>1997-09-21 23:04:51 +0000
commit0e710e8f950b0f88a0ed8c8fc795b3dcceedb53f (patch)
tree9540cbdef08b0806ab4dc4f3d95790883d43a588
parent94cad8bcb12918e8b255b7807cf264a6c22b4045 (diff)
Notes
-rw-r--r--lib/libc/rpc/get_myaddress.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index a96b84b0338d..b2ec39792636 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.11 1997/05/28 05:05:11 wpaul Exp $";
+static char *rcsid = "$Id: get_myaddress.c,v 1.12 1997/06/20 17:54:11 wpaul Exp $";
#endif
/*
@@ -87,8 +87,11 @@ again:
return(-1);
}
if (((ifreq.ifr_flags & IFF_UP) &&
- ifr->ifr_addr.sa_family == AF_INET) ||
- (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) {
+ ifr->ifr_addr.sa_family == AF_INET &&
+ !(ifreq.ifr_flags & IFF_LOOPBACK)) ||
+ (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK)
+ && (ifr->ifr_addr.sa_family == AF_INET)
+ && (ifr->ifr_flags & IFF_UP))) {
*addr = *((struct sockaddr_in *)&ifr->ifr_addr);
addr->sin_port = htons(PMAPPORT);
gotit = 1;