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.
This commit is contained in:
Yaroslav Tykhiy 2008-02-14 20:12:23 +00:00
parent 2e4760b66b
commit 870db2da6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176290

View File

@ -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);