diff options
author | Michael Brown | 2015-03-13 11:19:44 +0100 |
---|---|---|
committer | Michael Brown | 2015-03-13 11:19:44 +0100 |
commit | 57bab4e1d3c5ffae8f7c698937d20a01222275c5 (patch) | |
tree | a19bc08f6be21bbaf8f18cda72e21ed5c44746d4 /src/net/tcpip.c | |
parent | [smsc75xx] Move RX FIFO overflow message to DBGLVL_EXTRA (diff) | |
download | ipxe-57bab4e1d3c5ffae8f7c698937d20a01222275c5.tar.gz ipxe-57bab4e1d3c5ffae8f7c698937d20a01222275c5.tar.xz ipxe-57bab4e1d3c5ffae8f7c698937d20a01222275c5.zip |
[tcpip] Fix dubious calculation of min_port
Detected using sparse.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/tcpip.c')
-rw-r--r-- | src/net/tcpip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/tcpip.c b/src/net/tcpip.c index 261da582..5ad982fd 100644 --- a/src/net/tcpip.c +++ b/src/net/tcpip.c @@ -235,7 +235,7 @@ int tcpip_bind ( struct sockaddr_tcpip *st_local, /* Otherwise, find an available port in the range [1,1023] or * [1025,65535] as appropriate. */ - min_port = ( ( ( ! flags ) & TCPIP_BIND_PRIVILEGED ) + 1 ); + min_port = ( ( ( ~flags ) & TCPIP_BIND_PRIVILEGED ) + 1 ); max_port = ( ( flags & TCPIP_BIND_PRIVILEGED ) - 1 ); offset = random(); for ( i = 0 ; i <= max_port ; i++ ) { |