Re: [PATCH] usteer: Fix better candidate not being set in policy

2022-05-17 Thread David Bauer

Hi,

On 5/17/22 14:12, Wojciech Dubowik wrote:

The candidate is never set in this loop. Fix it by setting it
to the first valid entry.


Applied to master. Thanks!

Best
David



Signed-off-by: Wojciech Dubowik 
---
  policy.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/policy.c b/policy.c
index a7efc06..8155e24 100644
--- a/policy.c
+++ b/policy.c
@@ -143,7 +143,7 @@ find_better_candidate(struct sta_info *si_ref, struct 
uevent *ev, uint32_t requi
ev->select_reasons = reasons;
}
  
-		if (candidate && si->signal > candidate->signal)

+   if (!candidate || si->signal > candidate->signal)
candidate = si;
}
  


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] usteer: Fix better candidate not being set in policy

2022-05-17 Thread Wojciech Dubowik via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
The candidate is never set in this loop. Fix it by setting it
to the first valid entry.

Signed-off-by: Wojciech Dubowik 
---
 policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/policy.c b/policy.c
index a7efc06..8155e24 100644
--- a/policy.c
+++ b/policy.c
@@ -143,7 +143,7 @@ find_better_candidate(struct sta_info *si_ref, struct 
uevent *ev, uint32_t requi
ev->select_reasons = reasons;
}
 
-   if (candidate && si->signal > candidate->signal)
+   if (!candidate || si->signal > candidate->signal)
candidate = si;
}
 
-- 
2.25.1


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel