diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-02-16 09:29:35 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-02-16 09:29:35 -0800 |
commit | b3892e801f74c0fc6fae81fe7eb48e8b75a82c56 (patch) | |
tree | 6cd1463c666a20f07c4b51f3becb76d19128f0d8 | |
parent | 8890d206f44619726c9bfe902500be535f5c18d6 (diff) | |
download | tftp-hpa-b3892e801f74c0fc6fae81fe7eb48e8b75a82c56.tar.gz |
Correct the logic when to loop for the port range
-rw-r--r-- | tftpd/tftpd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 5e2a26e..24fe904 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -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 |