diff options
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/os2/sockets.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/network_io/os2/sockets.c b/network_io/os2/sockets.c index 2c1b249ec..381966425 100644 --- a/network_io/os2/sockets.c +++ b/network_io/os2/sockets.c @@ -140,6 +140,10 @@ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, return APR_OS2_STATUS(sock_errno()); else { sock->local_addr = sa; + /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */ + if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when comparing w/ 0 */ + sock->local_port_unknown = 1; /* kernel got us an ephemeral port */ + } return APR_SUCCESS; } } |