Skip to contentSkip to conversation

station: replace old BSS with 'best_bss' on roam scan

PATCH Applied James Prestwood 2 participants 2 messages Mar 4, 2022 – Mar 8, 2022

lore
Share & tools
lore

James Prestwood

author
#0 lore raw

PATCH 1/1 station: replace old BSS with 'best_bss' on roam scan

The logic here assumed any BSS's in the roam scan were identical to ones in station's bss_list with the same address. Usually this is true but, for example, if the BSS changed frequency the one in station's list is invalid.

Intead when a match is found remove the old BSS and re-insert the new one.

---
 src/station.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
src/station.c +6 -2
index 92b2667b..f6f0adac 100644
@@ -2368,8 +2368,12 @@ next:
 
 	bss = network_bss_find_by_addr(network, best_bss->addr);
 	if (bss) {
-		scan_bss_free(best_bss);
-		best_bss = bss;
+		network_bss_update(network, best_bss);
+		l_queue_remove(station->bss_list, bss);
+		scan_bss_free(bss);
+
+		l_queue_insert(station->bss_list, best_bss,
+				scan_bss_rank_compare, NULL);
 	} else {
 		network_bss_add(network, best_bss);
 		l_queue_push_tail(station->bss_list, best_bss);
Signature · 1 line
2.34.1
Applied
#1 lore raw

Hi James,

Quoted 6 lines · James Prestwood

The logic here assumed any BSS's in the roam scan were identical to ones in station's bss_list with the same address. Usually this is true but, for example, if the BSS changed frequency the one in station's list is invalid.

Intead when a match is found remove the old BSS and re-insert the new one.

Fixed this typo and...

Quoted 4 lines
---
  src/station.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)

Applied, thanks.

Regards,
-Denis