Patchwork [v3,14/15] driver_nl80211: listen to unexpected 4addr events

login
register
mail settings
Submitter Johannes Berg
Date Nov. 19, 2011, 12:39 p.m.
Message ID <20111119123953.592402279@sipsolutions.net>
Download mbox | patch
Permalink /patch/126581/
State Accepted
Commit 3088e4e52d2eec1a41fa05d2c46dbd6940094a86
Headers show

Comments

Johannes Berg - Nov. 19, 2011, 12:39 p.m.
From: Johannes Berg <johannes.berg@intel.com>

Monitor-less AP mode had lost the ability to do
4addr WDS, this adds it back.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 src/drivers/driver_nl80211.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
Jouni Malinen - Dec. 6, 2011, 5:33 p.m.
On Sat, Nov 19, 2011 at 01:39:24PM +0100, Johannes Berg wrote:
> Monitor-less AP mode had lost the ability to do
> 4addr WDS, this adds it back.

Thanks, applied.

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index f0af181..e99aa7f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1958,8 +1958,8 @@  static void nl80211_client_probe_event(struct wpa_driver_nl80211_data *drv,
 }
 
 
-static void nl80211_spurious_class3_frame(struct i802_bss *bss,
-					  struct nlattr **tb)
+static void nl80211_spurious_frame(struct i802_bss *bss, struct nlattr **tb,
+				   int wds)
 {
 	struct wpa_driver_nl80211_data *drv = bss->drv;
 	union wpa_event_data event;
@@ -1974,6 +1974,7 @@  static void nl80211_spurious_class3_frame(struct i802_bss *bss,
 	os_memset(&event, 0, sizeof(event));
 	event.rx_from_unknown.bssid = bssid;
 	event.rx_from_unknown.addr = nla_data(tb[NL80211_ATTR_MAC]);
+	event.rx_from_unknown.wds = wds;
 
 	wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event);
 }
@@ -2162,7 +2163,10 @@  static int process_bss_event(struct nl_msg *msg, void *arg)
 			   tb[NL80211_ATTR_COOKIE]);
 		break;
 	case NL80211_CMD_UNEXPECTED_FRAME:
-		nl80211_spurious_class3_frame(bss, tb);
+		nl80211_spurious_frame(bss, tb, 0);
+		break;
+	case NL80211_CMD_UNEXPECTED_4ADDR_FRAME:
+		nl80211_spurious_frame(bss, tb, 1);
 		break;
 	default:
 		wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event "