From 7973c9ed86ff9694d4cb4fa81eeb5b6bf7267e64 Mon Sep 17 00:00:00 2001 From: Eyal Shapira Date: Wed, 12 Sep 2012 02:04:17 +0300 Subject: nl80211: make unicast RX filter always match STA iface mac (ANDROID) This is part of changing the RX filters configuration to being global and not dependent on the interface context. RX filter #0 should point to a filter matching any unicast frame sent to the STA (wlan0) mac. The configuration is done by querying the mac address of the interface. As we now have reconfiguration of filters done from the context of the p2p interface filter #0 would get reconfigured with the P2P dev mac. Avoid this by hard coded querying for the mac of wlan0 when creating the pattern for RX filter #0. Signed-off-by: Eyal Shapira --- src/drivers/driver_nl80211.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index e0bf84f..35a818f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8922,13 +8922,13 @@ static u8 *nl80211_rx_filter_get_pattern(struct rx_filter *filter, void *arg) } static int -nl80211_self_filter_get_pattern_handler(u8 *buf, int buflen, void *arg) +nl80211_sta_unicast_filter_get_pattern_handler(u8 *buf, int buflen, void *arg) { int ret; struct i802_bss *bss = (struct i802_bss *)arg; ret = linux_get_ifhwaddr(bss->drv->global->ioctl_sock, - bss->ifname, buf); + "wlan0", buf); if (ret) { wpa_printf(MSG_ERROR, "Failed to get own HW addr (%d)", ret); return -1; @@ -8940,12 +8940,12 @@ nl80211_self_filter_get_pattern_handler(u8 *buf, int buflen, void *arg) static struct rx_filter rx_filters[NUM_RX_FILTERS] = { /* ID 0 */ - {.name = "self", + {.name = "sta_unicast", .pattern = {}, .pattern_len = 6, .mask = { BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) }, .mask_len = 1, - .get_pattern_handler = nl80211_self_filter_get_pattern_handler, + .get_pattern_handler = nl80211_sta_unicast_filter_get_pattern_handler, .action = NL80211_WOWLAN_ACTION_ALLOW, }, -- cgit v1.1