forked from mirrors/tftp-hpa-google
Correct the logic when to loop for the port range
This commit is contained in:
parent
8890d206f4
commit
b3892e801f
1 changed files with 1 additions and 1 deletions
|
@ -289,7 +289,7 @@ pick_port_bind(int sockfd, struct sockaddr_in *myaddr)
|
|||
|
||||
if (bind(sockfd, (struct sockaddr *)myaddr, sizeof *myaddr) < 0) {
|
||||
/* Some versions of Linux return EINVAL instead of EADDRINUSE */
|
||||
if ( !portrange || !(errno != EINVAL && errno != EADDRINUSE) )
|
||||
if ( !(portrange && (errno == EINVAL || errno == EADDRINUSE)) )
|
||||
return -1;
|
||||
|
||||
/* Normally, we shouldn't have to loop, but some situations involving
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue