nl80211: Fix secondary BSS ifindex

This was broken by a cleanup patch that moved from ifname to ifindex.
This commit is contained in:
Jouni Malinen 2009-04-17 13:33:30 +03:00 committed by Jouni Malinen
parent 4b9841d34c
commit 6d550fbeea

View file

@ -3560,13 +3560,13 @@ static int i802_bss_add(void *priv, const char *ifname, const u8 *bssid)
bss = os_zalloc(sizeof(*bss)); bss = os_zalloc(sizeof(*bss));
if (bss == NULL) if (bss == NULL)
return -1; return -1;
bss->ifindex = if_nametoindex(ifname);
ifidx = nl80211_create_iface(priv, ifname, NL80211_IFTYPE_AP, bssid); ifidx = nl80211_create_iface(priv, ifname, NL80211_IFTYPE_AP, bssid);
if (ifidx < 0) { if (ifidx < 0) {
os_free(bss); os_free(bss);
return -1; return -1;
} }
bss->ifindex = ifidx;
if (hostapd_set_iface_flags(priv, ifname, 1)) { if (hostapd_set_iface_flags(priv, ifname, 1)) {
nl80211_remove_iface(priv, ifidx); nl80211_remove_iface(priv, ifidx);
os_free(bss); os_free(bss);