From: John Crispin Date: Wed, 28 May 2025 13:44:13 +0000 (+0200) Subject: fix cross matching of weights X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=0badba1191f214f355524fbbdaa1f3b96a624c57;p=project%2Fufp.git fix cross matching of weights Signed-off-by: John Crispin --- 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) {