From a95353299c37a9b45a660e98d39f58843cefc63f Mon Sep 17 00:00:00 2001
From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Sat, 30 Jan 2010 16:08:02 +0000
Subject: [PATCH] hostapd: fix segfault in mac80211 wds ap handling

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19420 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 package/hostapd/patches/150-mbss_driver_handling.patch | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/hostapd/patches/150-mbss_driver_handling.patch b/package/hostapd/patches/150-mbss_driver_handling.patch
index ccae4e6db..412dc1cce 100644
--- a/package/hostapd/patches/150-mbss_driver_handling.patch
+++ b/package/hostapd/patches/150-mbss_driver_handling.patch
@@ -735,7 +735,7 @@
  	NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr);
  	NLA_PUT_U32(msg, NL80211_ATTR_STA_VLAN,
  		    if_nametoindex(ifname));
-@@ -4181,10 +4174,11 @@ static int i802_set_sta_vlan(void *priv,
+@@ -4181,18 +4174,19 @@ static int i802_set_sta_vlan(void *priv,
  
  static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val)
  {
@@ -747,9 +747,10 @@
 -	os_snprintf(name, sizeof(name), "%s.sta%d", drv->ifname, aid);
 +	os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid);
  	if (val) {
- 		if (nl80211_create_iface(priv, name, NL80211_IFTYPE_AP_VLAN,
+-		if (nl80211_create_iface(priv, name, NL80211_IFTYPE_AP_VLAN,
++		if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN,
  					 NULL, 1) < 0)
-@@ -4192,7 +4186,7 @@ static int i802_set_wds_sta(void *priv, 
+ 			return -1;
  		linux_set_iface_flags(drv->ioctl_sock, name, 1);
  		return i802_set_sta_vlan(priv, addr, name, 0);
  	} else {
-- 
2.20.1