From a09f9cc61629345bfadba0b0b564f704f870441c Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 28 Aug 2024 11:30:32 +0200 Subject: [PATCH] l3cfg: ensure the probing timeout is initialized on probe start When handling event TIMEOUT, "acd_data->probing_timeout_msec" needs to be always initialized before jumping to "handle_start_probing:"; otherwise, an assertion failure is triggered at: static void _l3_acd_data_timeout_schedule_probing_restart(AcdData *acd_data, gint64 now_msec) { ... nm_assert(acd_data->probing_timeout_msec > 0); Even if the ACD data is already in state PROBE, that doesn't mean that the timeout is already initialized because the PROBE state can also be reached from a INSTANCE_RESET event; and depending on the previous state "acd_data->probing_timeout_msec" could be uninitialized. Fixes-test: @iptunnel_restart Fixes: b8f9d7b5dd11 ('l3cfg: rework ACD handling in NML3Cfg to support handling conflicts') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2023 --- src/core/nm-l3cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index 57baeac25..2c9779914 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -2752,7 +2752,9 @@ handle_init: goto handle_start_defending; } - log_reason = "retry probing on timeout"; + acd_data->probing_timestamp_msec = (*p_now_msec); + acd_data->probing_timeout_msec = acd_timeout_msec; + log_reason = "retry probing on timeout"; goto handle_start_probing; }