From e4b78d83d6347858f7b0965f622725bcbcdfe433 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 20 Oct 2021 13:53:30 -0700 Subject: [PATCH] network: fix autoconnect for Open networks This code path was never tested and used to ensure a OWE transition candidate gets selected over an open one (e.g. if all the BSS's are blacklisted). But this logic was incorrect and the path was being taken for BSS's that did not contain the owe_trans element, basically all BSS's. For RSN's this was somewhat fine since the final check would set a candidate, but for open BSS's the loop would start over and potentially complete the loop without ever returning a candidate. If fallback was false, NULL would be returned. To fix this only take the OWE transition path if its an OWE transition BSS, i.e. inverse the logic. --- src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network.c b/src/network.c index 110c8577..9a2d12cf 100644 --- a/src/network.c +++ b/src/network.c @@ -1136,7 +1136,7 @@ struct scan_bss *network_bss_select(struct network *network, candidate = bss; /* OWE Transition BSS */ - if (!bss->owe_trans) { + if (bss->owe_trans) { /* Don't want to connect to the Open BSS if possible */ if (!bss->rsne) continue;