From d504b74c6182faff4328463476a6110886de4d40 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 17 Jan 2023 10:03:43 -0800 Subject: [PATCH] manager: handle -ENODEV special in interface callback If IWD ends up dumping wiphy's twice (because of NEW_WIPHY event soon after initial dump) it will also try and dump interfaces twice leading to multiple DEL_INTERFACE calls. The second attempt will fail with -ENODEV (since the interface was already deleted). Just silently fail with this case and let the other DEL_INTERFACE path handle the re-creation. --- src/manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index fed02777..f1aa59c7 100644 --- a/src/manager.c +++ b/src/manager.c @@ -320,13 +320,18 @@ static void manager_setup_cmd_done(void *user_data) static void manager_del_interface_cb(struct l_genl_msg *msg, void *user_data) { struct wiphy_setup_state *state = user_data; + int err; l_debug(""); if (state->aborted) return; - if (l_genl_msg_get_error(msg) < 0) { + err = l_genl_msg_get_error(msg); + + if (err == -ENODEV) + return; + else if (err < 0) { l_error("DEL_INTERFACE failed: %s", strerror(-l_genl_msg_get_error(msg))); state->use_default = true;