From 6eee1214a2fc60c6145031be3c85af622341447e Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Mon, 20 Nov 2017 19:54:28 +0100 Subject: [PATCH] fix eval probe metric --- src/storage/datastorage.c | 4 ++-- src/utils/ubus.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 936f652..c8eda89 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -71,9 +71,9 @@ int eval_probe_metric(struct probe_entry_s probe_entry) { // check if ap entry is available if (mac_is_equal(ap_entry.bssid_addr, probe_entry.bssid_addr)) { - score += probe_entry.ht_support ? dawn_metric.ht_support : 0; + score += probe_entry.ht_support && ap_entry.ht ? dawn_metric.ht_support : 0; score += !probe_entry.ht_support && !ap_entry.ht ? dawn_metric.no_ht_support : 0; - score += probe_entry.vht_support ? dawn_metric.vht_support : 0; + score += probe_entry.vht_support && ap_entry.vht ? dawn_metric.vht_support : 0; score += !probe_entry.vht_support && !ap_entry.vht ? dawn_metric.no_vht_support : 0; score += ap_entry.channel_utilization <= dawn_metric.max_chan_util ? dawn_metric.chan_util : 0; } diff --git a/src/utils/ubus.c b/src/utils/ubus.c index 42f5573..33e7488 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -377,7 +377,7 @@ static int add_subscriber(char *name) { fprintf(stderr, "Failed to look up test object for %s\n", name); return -1; } - + if(hostapd_array_check_id(id)) { return 0;