1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -2289,6 +2289,7 @@ static void * wpa_driver_nl80211_init(vo
4 drv->monitor_ifidx = -1;
5 drv->monitor_sock = -1;
6 drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
7 + drv->nlmode = NL80211_IFTYPE_STATION;
9 if (wpa_driver_nl80211_init_nl(drv)) {
11 @@ -2446,37 +2447,37 @@ wpa_driver_nl80211_finish_drv_init(struc
12 drv->ifindex = if_nametoindex(bss->ifname);
13 drv->first_bss.ifindex = drv->ifindex;
17 - * Make sure the interface starts up in station mode unless this is a
18 - * dynamically added interface (e.g., P2P) that was already configured
19 - * with proper iftype.
21 - if ((drv->global == NULL ||
22 - drv->ifindex != drv->global->if_add_ifindex) &&
23 - wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
24 - wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
25 - "use managed mode");
29 - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
30 - if (rfkill_is_blocked(drv->rfkill)) {
31 - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
32 - "interface '%s' due to rfkill",
34 - drv->if_disabled = 1;
35 - send_rfkill_event = 1;
37 - wpa_printf(MSG_ERROR, "nl80211: Could not set "
38 - "interface '%s' UP", bss->ifname);
39 + if (drv->nlmode == NL80211_IFTYPE_STATION) {
41 + * Make sure the interface starts up in station mode unless this is a
42 + * dynamically added interface (e.g., P2P) that was already configured
43 + * with proper iftype.
45 + if ((drv->global == NULL ||
46 + drv->ifindex != drv->global->if_add_ifindex) &&
47 + wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
48 + wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
49 + "use managed mode");
54 - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
55 - 1, IF_OPER_DORMANT);
57 + if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
58 + if (rfkill_is_blocked(drv->rfkill)) {
59 + wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
60 + "interface '%s' due to rfkill",
62 + drv->if_disabled = 1;
63 + send_rfkill_event = 1;
65 + wpa_printf(MSG_ERROR, "nl80211: Could not set "
66 + "interface '%s' UP", bss->ifname);
71 + netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
72 + 1, IF_OPER_DORMANT);
75 if (wpa_driver_nl80211_capa(drv))