summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/get_myaddress.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1997-05-28 05:05:31 +0000
committerwpaul <wpaul@FreeBSD.org>1997-05-28 05:05:31 +0000
commit9e8ab1e62292b0db38935cfbd4d0f2b8ae9d9a91 (patch)
treefe57d84f04c73758d7f713f9140e48e516bd468c /lib/libc/rpc/get_myaddress.c
parentacb47603edac092ecefcbe769df4dbbe55d0ba08 (diff)
downloadFreeBSD-src-9e8ab1e62292b0db38935cfbd4d0f2b8ae9d9a91.zip
FreeBSD-src-9e8ab1e62292b0db38935cfbd4d0f2b8ae9d9a91.tar.gz
Resolve conflicts.
This concludes tonight's entertainment. Once I'm sure I haven't destroyed the world with all these changes, I'll import the utilities. Everything should continue to work as before. If it doesn't let me know. Special thanks to Mark Murray for running a test 'make world' for me to shake out the bugs, which, hopefully, I have fixed. (And there was much rejoicing.)
Diffstat (limited to 'lib/libc/rpc/get_myaddress.c')
-rw-r--r--lib/libc/rpc/get_myaddress.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c
index cb7ac9e..f8bfa7c 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$";
+static char *rcsid = "$Id: get_myaddress.c,v 1.6 1996/12/30 14:26:28 peter Exp $";
#endif
/*
@@ -62,7 +62,7 @@ get_myaddress(addr)
struct sockaddr_in *addr;
{
int s;
- char buf[1024 * 8];
+ char buf[BUFSIZ];
struct ifconf ifc;
struct ifreq ifreq, *ifr, *end;
int loopback = 0, gotit = 0;
@@ -88,7 +88,7 @@ again:
}
if ((ifreq.ifr_flags & IFF_UP) &&
ifr->ifr_addr.sa_family == AF_INET &&
- (loopback == 1 || !(ifreq.ifr_flags & IFF_LOOPBACK))) {
+ (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) {
*addr = *((struct sockaddr_in *)&ifr->ifr_addr);
addr->sin_port = htons(PMAPPORT);
gotit = 1;
@@ -105,7 +105,5 @@ again:
goto again;
}
(void) close(s);
- if (gotit == 0) /* still found nothing?? */
- return (-1);
return (0);
}
OpenPOWER on IntegriCloud