prefer ipv4 listen addresses
This commit is contained in:
parent
4e9ee330df
commit
1e45ce07e4
|
@ -851,7 +851,12 @@ static void sigar_net_listen_address_add(sigar_t *sigar,
|
||||||
sigar_cache_entry_t *entry =
|
sigar_cache_entry_t *entry =
|
||||||
sigar_cache_get(sigar->net_listen, conn->local_port);
|
sigar_cache_get(sigar->net_listen, conn->local_port);
|
||||||
|
|
||||||
if (!entry->value) {
|
if (entry->value) {
|
||||||
|
if (conn->local_address.family == SIGAR_AF_INET6) {
|
||||||
|
return; /* prefer ipv4 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
entry->value = malloc(sizeof(conn->local_address));
|
entry->value = malloc(sizeof(conn->local_address));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue