From: Howard Chu Date: Thu, 7 Mar 2002 20:23:48 +0000 (+0000) Subject: Fix ITS#1615 X-Git-Tag: OPENLDAP_REL_ENG_2_MP~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f0a453dfca046808490361355ab329fc57e5f200;p=openldap Fix ITS#1615 --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 6180e391b5..aca6614a0e 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -897,7 +897,7 @@ static Listener * slap_open_listener( #else s = inet_ntoa( ((struct sockaddr_in *) *sal)->sin_addr ); #endif - port = ((struct sockaddr_in *)*sal) ->sin_port; + port = ntohs( ((struct sockaddr_in *)*sal) ->sin_port ); l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65535") ); sprintf( l.sl_name, "IP=%s:%d", s != NULL ? s : "unknown" , port ); @@ -908,7 +908,7 @@ static Listener * slap_open_listener( char addr[INET6_ADDRSTRLEN]; inet_ntop( AF_INET6, &((struct sockaddr_in6 *)*sal)->sin6_addr, addr, sizeof addr); - port = ((struct sockaddr_in6 *)*sal)->sin6_port; + port = ntohs( ((struct sockaddr_in6 *)*sal)->sin6_port ); l.sl_name = ch_malloc( strlen(addr) + sizeof("IP= 65535") ); sprintf( l.sl_name, "IP=%s %d", addr, port ); } break;