-@@ -3738,7 +3737,8 @@ static void nl80211_remove_iface(struct
-
- #ifdef HOSTAPD
- /* stop listening for EAPOL on this interface */
-- del_ifidx(drv, ifidx);
-+ if (drv->nlmode == NL80211_IFTYPE_AP)
-+ del_ifidx(drv, ifidx);
- #endif /* HOSTAPD */
-
- msg = nlmsg_alloc();
-@@ -3811,7 +3811,8 @@ static int nl80211_create_iface_once(str
-
- #ifdef HOSTAPD
- /* start listening for EAPOL on this interface */
-- add_ifidx(drv, ifidx);
-+ if (drv->nlmode == NL80211_IFTYPE_AP)
-+ add_ifidx(drv, ifidx);
- #endif /* HOSTAPD */
-
- if (addr && iftype != NL80211_IFTYPE_MONITOR &&