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