Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275674
b: refs/heads/master
c: 3b6ef63
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 7, 2011
1 parent 9fbc1a5 commit 686ac19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 133a3ff2c934223a8143bfa52401bba962a97165
refs/heads/master: 3b6ef6334febb05d3050a96546e635f038dbcb15
13 changes: 8 additions & 5 deletions trunk/net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,20 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2)
{
const u8 *ie1 = cfg80211_find_ie(num, ies1, len1);
const u8 *ie2 = cfg80211_find_ie(num, ies2, len2);
int r;

/* equal if both missing */
if (!ie1 && !ie2)
return 0;
if (!ie1 || !ie2)
/* sort missing IE before (left of) present IE */
if (!ie1)
return -1;
if (!ie2)
return 1;

r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1]));
if (r == 0 && ie1[1] != ie2[1])
/* sort by length first, then by contents */
if (ie1[1] != ie2[1])
return ie2[1] - ie1[1];
return r;
return memcmp(ie1 + 2, ie2 + 2, ie1[1]);
}

static bool is_bss(struct cfg80211_bss *a,
Expand Down

0 comments on commit 686ac19

Please sign in to comment.