fix cross matching of weights
authorJohn Crispin <[email protected]>
Wed, 28 May 2025 13:44:13 +0000 (15:44 +0200)
committerJohn Crispin <[email protected]>
Wed, 28 May 2025 13:44:13 +0000 (15:44 +0200)
Signed-off-by: John Crispin <[email protected]>
ufpd

diff --git a/ufpd b/ufpd
index 11c62846870a8cad9001ca3368ca9d5fd88d87ee..6d5a55f68f0271a9256cd63979c7a82efaa939f2 100755 (executable)
--- 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) {