From 503fa9df7b098214913472bce41632aef3484740 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 9 Oct 2020 13:23:16 +0200 Subject: [PATCH] device: in NMDeviceVxlan let address_matches ensure the unused address is NULL We should only either set addr4 or addr6, not both. Let address_matches() check that the respective other address is null/unspecified. --- src/devices/nm-device-vxlan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device-vxlan.c b/src/devices/nm-device-vxlan.c index 1aa3786f89..4522662449 100644 --- a/src/devices/nm-device-vxlan.c +++ b/src/devices/nm-device-vxlan.c @@ -229,7 +229,10 @@ address_matches(const char *candidate, in_addr_t addr4, struct in6_addr *addr6) NM_IS_IPv4(addr_family) ? (gpointer) &addr4 : addr6)) return FALSE; - return TRUE; + if (NM_IS_IPv4(addr_family)) + return IN6_IS_ADDR_UNSPECIFIED(addr6); + else + return addr4 == 0u; } static gboolean