diff --git a/wifi/1.4/default/wifi_chip.cpp b/wifi/1.4/default/wifi_chip.cpp index 61912a53e0..fa4f354e62 100644 --- a/wifi/1.4/default/wifi_chip.cpp +++ b/wifi/1.4/default/wifi_chip.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -885,7 +886,7 @@ std::pair> WifiChip::createNanIfaceInternal() { } bool is_dedicated_iface = true; std::string ifname = getNanIfaceName(); - if (ifname.empty()) { + if (ifname.empty() || if_nametoindex(ifname.c_str())) { // Use the first shared STA iface (wlan0) if a dedicated aware iface is // not defined. ifname = getFirstActiveWlanIfaceName();