summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-06-23 14:58:42 +0200
committerThomas Haller <thaller@redhat.com>2022-06-23 17:11:28 +0200
commit6b0f67b7368d361cee2cfbfe3866264714556a5b (patch)
treeb561e24b9d9de539bd76a4c374b122e32c2b64f3
parent0e2ddfd071e7be9c400e435ac310468002ef4b70 (diff)
connectivity: skip unexpected address families in system_resolver_resolve_cb()
This actually cannot happen, because GInetAddress is either IPv4 or IPv6. Still.
-rw-r--r--src/core/nm-connectivity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c
index eea8adb2ef..25ac3c7f8c 100644
--- a/src/core/nm-connectivity.c
+++ b/src/core/nm-connectivity.c
@@ -816,8 +816,7 @@ system_resolver_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer u
addr_family = AF_INET6;
break;
default:
- addr_family = AF_UNSPEC;
- break;
+ goto next;
}
if (cb_data->addr_family != AF_UNSPEC && cb_data->addr_family != addr_family)
continue;
@@ -832,6 +831,7 @@ system_resolver_resolve_cb(GObject *source_object, GAsyncResult *res, gpointer u
nm_str_buf_append(&strbuf_hosts,
nm_utils_inet_ntop(addr_family, g_inet_address_to_bytes(a), str_addr));
+next:;
}
g_list_free_full(list, g_object_unref);