SSID won't be reported, but is available via WEXT.
This is very silly, but dhcpcd still needs to work.
Thus enable both protocols and use nl80211 if WEXT fails.
echo "#define HAVE_NL80211_H" >>$CONFIG_H
else
echo "no"
- echo "DHCPCD_SRCS+= if-linux-wext.c" >>$CONFIG_MK
fi
rm -f _nl80211.c _nl80211
+
+ # Even though we have nl80211, we only use it as a fallback
+ # because it's currently possible to configure a kernel
+ # where the SSID associated to won't be reported by nl80211
+ # but will be via WEXT.
+ echo "DHCPCD_SRCS+= if-linux-wext.c" >>$CONFIG_MK
fi
abort=false
return ifp->ssid_len;
}
-int
-if_getssid(struct interface *ifp)
+static int
+if_getssid_nl80211(struct interface *ifp)
{
int family;
struct nlmg nlm;
return send_netlink(ifp->ctx, ifp,
NETLINK_GENERIC, &nlm.hdr, &_if_getssid);
}
-#else
+#endif
+
int
if_getssid(struct interface *ifp)
{
r = if_getssid_wext(ifp->name, ifp->ssid);
if (r != -1)
ifp->ssid_len = r;
+#ifdef HAVE_NL80211_H
+ else if (r == -1)
+ r = if_getssid_nl80211(ifp);
+#endif
return r;
}
-#endif
struct nlma
{