[PATCH v2 2/6] Revert "nl80211: Indicate interface-down event only for the main netdev"

Alexander Savchenko oleksandr.savchenko at celeno.com
Tue Sep 6 09:14:06 PDT 2022


This reverts commit 106fa1e97e29e7514ae324020802c280f993ee48.

Commit 106fa1e97 breaks the virtual AP mode due to non-main interfaces
can't receive DOWN state.

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

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 89e9cd112..2812d36a4 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1245,9 +1245,9 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
 		return; /* do not update interface state */
 
 	if (!drv->if_disabled && !(ifi->ifi_flags & IFF_UP)) {
-		namebuf[0] = '\0';
 		if (if_indextoname(ifi->ifi_index, namebuf) &&
-		    linux_iface_up(drv->global->ioctl_sock, namebuf) > 0) {
+		    linux_iface_up(drv->global->ioctl_sock,
+				   drv->first_bss->ifname) > 0) {
 			wpa_printf(MSG_DEBUG, "nl80211: Ignore interface down "
 				   "event since interface %s is up", namebuf);
 			drv->ignore_if_down_event = 0;
@@ -1255,13 +1255,8 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
 			nl80211_refresh_mac(drv, ifi->ifi_index, 1);
 			return;
 		}
-		wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)",
-			   namebuf, ifname);
-		if (os_strcmp(drv->first_bss->ifname, ifname) != 0) {
-			wpa_printf(MSG_DEBUG,
-				   "nl80211: Not the main interface (%s) - do not indicate interface down",
-				   drv->first_bss->ifname);
-		} else if (drv->ignore_if_down_event) {
+		wpa_printf(MSG_DEBUG, "nl80211: Interface down");
+		if (drv->ignore_if_down_event) {
 			wpa_printf(MSG_DEBUG, "nl80211: Ignore interface down "
 				   "event generated by mode change");
 			drv->ignore_if_down_event = 0;
@@ -1284,7 +1279,8 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
 
 	if (drv->if_disabled && (ifi->ifi_flags & IFF_UP)) {
 		if (if_indextoname(ifi->ifi_index, namebuf) &&
-		    linux_iface_up(drv->global->ioctl_sock, namebuf) == 0) {
+		    linux_iface_up(drv->global->ioctl_sock,
+				   drv->first_bss->ifname) == 0) {
 			wpa_printf(MSG_DEBUG, "nl80211: Ignore interface up "
 				   "event since interface %s is down",
 				   namebuf);
-- 
2.25.0




More information about the Hostap mailing list