mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-01 14:15:49 +08:00
Fix port reporting
This commit is contained in:
parent
fab52fa4ab
commit
8f6f39063c
@ -548,9 +548,11 @@ 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 );
|
||||
#endif
|
||||
port = l.sl_addr.sin_port;
|
||||
#endif
|
||||
l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65535") );
|
||||
sprintf( l.sl_name, "IP=%s:%d",
|
||||
s != NULL ? s : "unknown" , port );
|
||||
@ -561,6 +563,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;
|
||||
l.sl_name = ch_malloc( strlen(addr) + sizeof("IP= 65535") );
|
||||
sprintf( l.sl_name, "IP=%s %d", addr, port );
|
||||
} break;
|
||||
|
Loading…
Reference in New Issue
Block a user