summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpcbind
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2008-02-14 20:12:23 +0000
committeryar <yar@FreeBSD.org>2008-02-14 20:12:23 +0000
commit8249be02c2a839362eaeb918ae467c842c75b899 (patch)
tree1f348f92ce7718ce6fd29141f54612ac72dba792 /usr.sbin/rpcbind
parent0d1deccf8cf1c11e820910032c00c267a4d66387 (diff)
downloadFreeBSD-src-8249be02c2a839362eaeb918ae467c842c75b899.zip
FreeBSD-src-8249be02c2a839362eaeb918ae467c842c75b899.tar.gz
No network addresses in the system isn't a good excuse
for rpcbind(8) to crash. The crash was due to a boolean variable initialized improperly. Besides fixing the initialization, pick a better name for the variable so that its meaning is clear and no more coding errors appear around it.
Diffstat (limited to 'usr.sbin/rpcbind')
-rw-r--r--usr.sbin/rpcbind/rpcbind.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index ed89916..b601da5 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -250,7 +250,7 @@ init_transport(struct netconfig *nconf)
int aicode;
int addrlen;
int nhostsbak;
- int checkbind;
+ int bound;
struct sockaddr *sa;
u_int32_t host_addr[4]; /* IPv4 or IPv6 */
struct sockaddr_un sun;
@@ -340,7 +340,7 @@ init_transport(struct netconfig *nconf)
/*
* Bind to specific IPs if asked to
*/
- checkbind = 1;
+ bound = 0;
while (nhostsbak > 0) {
--nhostsbak;
/*
@@ -423,7 +423,7 @@ init_transport(struct netconfig *nconf)
freeaddrinfo(res);
continue;
} else
- checkbind++;
+ bound = 1;
(void)umask(oldmask);
/* Copy the address */
@@ -467,7 +467,7 @@ init_transport(struct netconfig *nconf)
goto error;
}
}
- if (!checkbind)
+ if (!bound)
return 1;
} else {
oldmask = umask(S_IXUSR|S_IXGRP|S_IXOTH);
OpenPOWER on IntegriCloud