[PATCH v1 4/6] nl80211: Remove obsolete ifindex

oleksandr.savchenko at celeno.com oleksandr.savchenko at celeno.com
Thu Jul 14 09:53:04 PDT 2022


From: Alexander Savchenko <oleksandr.savchenko at celeno.com>

When the ifindex of the interface is changed, the obsolete ifindex is
not removed from the local ifidx list and have_idx()
can return false positive.
ifindex can be changed after calling of device_reprobe() in some wifi drivers.

Signed-off-by: Alexander Savchenko <oleksandr.savchenko at celeno.com>
---
 src/drivers/driver_nl80211.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a14642695..9bac97834 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1111,6 +1111,7 @@ static int wpa_driver_nl80211_own_ifindex(struct wpa_driver_nl80211_data *drv,
 		nl80211_check_global(drv->global);
 		wpa_printf(MSG_DEBUG, "nl80211: Update ifindex for a removed "
 			   "interface");
+		del_ifidx(drv, drv->ifindex, IFIDX_ANY);
 		if (wpa_driver_nl80211_finish_drv_init(drv, NULL, 0, NULL) < 0)
 			return -1;
 		return 1;
-- 
2.25.0




More information about the Hostap mailing list