From 870db2da6dee7d97eec9282b7b1492acd854ea64 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Thu, 14 Feb 2008 20:12:23 +0000 Subject: [PATCH] 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. --- usr.sbin/rpcbind/rpcbind.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index ed89916f9174..b601da5b6f65 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);