summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-03-17 10:06:21 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2022-03-22 18:12:47 +0100
commit1d2077e9b2d72f3899c256bf24791e9c5d7b68dd (patch)
tree918aa01f6b845f1fb5cb1efbc9be13a014c230a0
parent47ef6db049b65358c213ecd9d13ca880037a2a75 (diff)
downloadNetworkManager-1d2077e9b2d72f3899c256bf24791e9c5d7b68dd.tar.gz
connectivity: skip unexpected addr family from resolved response
In practice, systemd-resolved will give us always AF_INET/AF_INET6. Still, check for that. (cherry picked from commit 593d08db81f2c52ddd7bde6c1b4381f9fbfef875)
-rw-r--r--src/core/nm-connectivity.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c
index eee837be17..c08ee62c1a 100644
--- a/src/core/nm-connectivity.c
+++ b/src/core/nm-connectivity.c
@@ -738,6 +738,9 @@ resolve_cb(GObject *object, GAsyncResult *res, gpointer user_data)
g_variant_get_child(addresses, i, "(ii@ay)", &ifindex, &addr_family, &address);
+ if (!NM_IN_SET(addr_family, AF_INET, AF_INET6))
+ continue;
+
if (cb_data->addr_family != AF_UNSPEC && cb_data->addr_family != addr_family)
continue;