merge mac80211, iw, hostapd from trunk to backfire
[openwrt-10.03/.git] / package / hostapd / patches / 350-wds_fix.patch
1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -4652,9 +4652,11 @@ static int i802_set_wds_sta(void *priv, 
4         wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR
5                    " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name);
6         if (val) {
7 -               if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN,
8 +               if (!if_nametoindex(name)) {
9 +                       if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN,
10                                          NULL, 1) < 0)
11 -                       return -1;
12 +                               return -1;
13 +               }
14                 linux_set_iface_flags(drv->ioctl_sock, name, 1);
15                 return i802_set_sta_vlan(priv, addr, name, 0);
16         } else {
17 --- a/src/ap/ieee802_11.c
18 +++ b/src/ap/ieee802_11.c
19 @@ -1627,6 +1627,9 @@ static void handle_assoc_cb(struct hosta
20                                "Could not add STA to kernel driver");
21         }
22  
23 +       if (sta->flags & WLAN_STA_WDS)
24 +               hapd->drv.set_wds_sta(hapd, sta->addr, sta->aid, 1);
25 +
26         if (sta->eapol_sm == NULL) {
27                 /*
28                  * This STA does not use RADIUS server for EAP authentication,