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.
This commit is contained in:
Thomas Haller 2020-10-09 13:23:16 +02:00
parent 71f681814b
commit 503fa9df7b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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