linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wireless: Compare ethernet addresses by unaligned safe way
@ 2009-06-16 10:54 Yauhen Kharuzhy
  2009-06-16 11:14 ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Yauhen Kharuzhy @ 2009-06-16 10:54 UTC (permalink / raw)
  To: linux-wireless; +Cc: Yauhen Kharuzhy

When we try to run RTL8187 driver on AD BlackFin platform, we got
messages from kernel about unaligned memory access at
compare_ether_addr() calls.

Replacing of compare_ether_addr() by memcmp() fixes this problem.

Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
---
 net/mac80211/ibss.c |    2 +-
 net/wireless/scan.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 0b30277..bcbb1ae 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -395,7 +395,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
 		return NULL;
 	}
 
-	if (compare_ether_addr(bssid, sdata->u.ibss.bssid))
+	if (memcmp(bssid, sdata->u.ibss.bssid, ETH_ALEN))
 		return NULL;
 
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index e95b638..6ad9b59 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -134,7 +134,7 @@ static bool is_bss(struct cfg80211_bss *a,
 {
 	const u8 *ssidie;
 
-	if (bssid && compare_ether_addr(a->bssid, bssid))
+	if (bssid && memcmp(a->bssid, bssid, ETH_ALEN))
 		return false;
 
 	if (!ssid)
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-07 15:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16 10:54 [PATCH] wireless: Compare ethernet addresses by unaligned safe way Yauhen Kharuzhy
2009-06-16 11:14 ` Johannes Berg
2009-06-28 12:18   ` Ivan Kuten
2009-06-29  7:58     ` Johannes Berg
2009-07-23 17:56       ` Ivan Kuten
2009-07-23 17:59         ` Johannes Berg
2009-08-07 15:34           ` John W. Linville
2009-06-29  8:23     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).