summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin2025-05-28 13:44:13 +0000
committerJohn Crispin2025-05-28 13:44:13 +0000
commit0badba1191f214f355524fbbdaa1f3b96a624c57 (patch)
tree15d11bf70e2d2e0a145dc34c6f45e9bf1bb18f06
parent4536dd8e3719b2898f6fc7e24f60e8e3c1631193 (diff)
downloadufp-0badba1191f214f355524fbbdaa1f3b96a624c57.tar.gz
fix cross matching of weights
Signed-off-by: John Crispin <john@phrozen.org>
-rwxr-xr-xufpd11
1 files changed, 8 insertions, 3 deletions
diff --git a/ufpd b/ufpd
index 11c6284..6d5a55f 100755
--- a/ufpd
+++ b/ufpd
@@ -242,13 +242,18 @@ function __device_match_list(mac, devices)
let cur = match_devs[j];
let cur_data = cur[0];
+ let data_match;
for (let key in cur_data) {
- if (lc(match_data[key]) == lc(cur_data[key])) {
- match_weight += cur[1];
- push(match_fp, cur[2]);
+ data_match ??= true;
+ if (lc(match_data[key]) != lc(cur_data[key])) {
+ data_match = false;
break;
}
}
+ if (data_match) {
+ match_weight += cur[1];
+ push(match_fp, cur[2]);
+ }
}
for (let key in match_data) {