320-nl80211_multicall_fixes.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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;
  8. if (wpa_driver_nl80211_init_nl(drv)) {
  9. os_free(drv);
  10. @@ -2446,37 +2447,37 @@ wpa_driver_nl80211_finish_drv_init(struc
  11. drv->ifindex = if_nametoindex(bss->ifname);
  12. drv->first_bss.ifindex = drv->ifindex;
  13. -#ifndef HOSTAPD
  14. - /*
  15. - * Make sure the interface starts up in station mode unless this is a
  16. - * dynamically added interface (e.g., P2P) that was already configured
  17. - * with proper iftype.
  18. - */
  19. - if ((drv->global == NULL ||
  20. - drv->ifindex != drv->global->if_add_ifindex) &&
  21. - wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
  22. - wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
  23. - "use managed mode");
  24. - return -1;
  25. - }
  26. -
  27. - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
  28. - if (rfkill_is_blocked(drv->rfkill)) {
  29. - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
  30. - "interface '%s' due to rfkill",
  31. - bss->ifname);
  32. - drv->if_disabled = 1;
  33. - send_rfkill_event = 1;
  34. - } else {
  35. - wpa_printf(MSG_ERROR, "nl80211: Could not set "
  36. - "interface '%s' UP", bss->ifname);
  37. + if (drv->nlmode == NL80211_IFTYPE_STATION) {
  38. + /*
  39. + * Make sure the interface starts up in station mode unless this is a
  40. + * dynamically added interface (e.g., P2P) that was already configured
  41. + * with proper iftype.
  42. + */
  43. + if ((drv->global == NULL ||
  44. + drv->ifindex != drv->global->if_add_ifindex) &&
  45. + wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
  46. + wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
  47. + "use managed mode");
  48. return -1;
  49. }
  50. - }
  51. - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
  52. - 1, IF_OPER_DORMANT);
  53. -#endif /* HOSTAPD */
  54. + if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
  55. + if (rfkill_is_blocked(drv->rfkill)) {
  56. + wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
  57. + "interface '%s' due to rfkill",
  58. + bss->ifname);
  59. + drv->if_disabled = 1;
  60. + send_rfkill_event = 1;
  61. + } else {
  62. + wpa_printf(MSG_ERROR, "nl80211: Could not set "
  63. + "interface '%s' UP", bss->ifname);
  64. + return -1;
  65. + }
  66. + }
  67. +
  68. + netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
  69. + 1, IF_OPER_DORMANT);
  70. + }
  71. if (wpa_driver_nl80211_capa(drv))
  72. return -1;