mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-05-28 04:35:57 -04:00
Fix ITS#1615, ITS#1728 port byte-order, addr initialization
This commit is contained in:
parent
175399c2bb
commit
393fe63451
1 changed files with 3 additions and 4 deletions
|
|
@ -537,11 +537,10 @@ static Listener * slap_open_listener(
|
|||
inet_ntop( AF_INET, &((struct sockaddr_in *)*sal)->sin_addr,
|
||||
addr, sizeof(addr) );
|
||||
s = addr;
|
||||
port = ((struct sockaddr_in *)*sal) ->sin_port;
|
||||
#else
|
||||
s = inet_ntoa( l.sl_addr.sin_addr );
|
||||
port = l.sl_addr.sin_port;
|
||||
s = inet_ntoa( ((struct sockaddr_in *) *sal)->sin_addr );
|
||||
#endif
|
||||
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 );
|
||||
|
|
@ -552,7 +551,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue