summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vaclav <jvaclav@redhat.com>2023-10-02 10:50:51 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2023-10-11 08:14:40 +0000
commitaa84b5f935d008ce5a12664b6e46e5e141eb9a39 (patch)
tree96ac2a35ca674d3bb0b20a8b6f12bcbfeb33dec3
parent8ed1b8daec5ea902ac9aff79773721caa89b2328 (diff)
device: fix assertion failure caused by DAD array reuse
This commit fixes an assertion failure caused by the `conflicts` array being reused when both IPv4 and IPv6 duplicate address detection occurs. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1747 Fixes: afa208c862d8 ('core: return conflicting addresses from nm_l3cfg_check_ready()')
-rw-r--r--src/core/devices/nm-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 4f4715b06d..2a0a156bca 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -10369,7 +10369,6 @@ _dev_ipmanual_check_ready(NMDevice *self)
gboolean has_carrier;
NML3CfgCheckReadyFlags flags;
gboolean ready;
- gs_unref_array GArray *conflicts = NULL;
int IS_IPv4;
if (priv->ipmanual_data.state_4 != NM_DEVICE_IP_STATE_PENDING
@@ -10403,7 +10402,8 @@ _dev_ipmanual_check_ready(NMDevice *self)
flags |= NM_L3CFG_CHECK_READY_FLAGS_IP6_DAD_READY;
for (IS_IPv4 = 0; IS_IPv4 < 2; IS_IPv4++) {
- const int addr_family = IS_IPv4 ? AF_INET : AF_INET6;
+ const int addr_family = IS_IPv4 ? AF_INET : AF_INET6;
+ gs_unref_array GArray *conflicts = NULL;
ready = nm_l3cfg_check_ready(priv->l3cfg,
priv->l3cds[L3_CONFIG_DATA_TYPE_MANUALIP].d,