From: Mohammed Shafi Shajakhan Date: Tue, 10 Apr 2012 20:55:06 +0530 Subject: [ath9k-devel] [RFC 1/1] cfg80211: have consistent checks for adding new entries in scan list Message-ID: <1334071506-22131-1-git-send-email-mohammed@qca.qualcomm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org From: Mohammed Shafi Shajakhan *decide to traverse the RB tree in right - if the center frequency of new scan list entry is greater than the already available entries - if the IE length of new scan list entry is greater than the already available entries this is in consistent with checks for BSSID, IE information checks not sure if this done specifically for some other reason Signed-off-by: Mohammed Shafi Shajakhan --- net/wireless/scan.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 70faadf..fda4eef 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -271,7 +271,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2) /* sort by length first, then by contents */ if (ie1[1] != ie2[1]) - return ie2[1] - ie1[1]; + return ie1[1] - ie2[1]; return memcmp(ie1 + 2, ie2 + 2, ie1[1]); } @@ -361,7 +361,7 @@ static int cmp_bss_core(struct cfg80211_bss *a, int r; if (a->channel != b->channel) - return b->channel->center_freq - a->channel->center_freq; + return a->channel->center_freq - b->channel->center_freq; if (is_mesh_bss(a) && is_mesh_bss(b)) { r = cmp_ies(WLAN_EID_MESH_ID, @@ -433,7 +433,7 @@ static int cmp_hidden_bss(struct cfg80211_bss *a, /* sort by length first, then by contents */ if (ie1[1] != ie2[1]) - return ie2[1] - ie1[1]; + return ie1[1] - ie2[1]; /* zeroed SSID ie is another indication of a hidden bss */ for (i = 0; i < ie2[1]; i++) -- 1.7.0.4