prefer ipv4 listen addresses

This commit is contained in:
Doug MacEachern 2007-04-06 16:22:24 +00:00
parent 4e9ee330df
commit 1e45ce07e4
1 changed files with 6 additions and 1 deletions

View File

@ -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));
} }