mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-02-14 17:51:51 +00:00
ubus: make decide_function consist with configuration
in luci-app-dawn, if eval_probe_req is not ticked, eval_probe_req would be -1. however, in c language, !(-1) is false. Since only zero in if statement is false, non-zero number is true.
This commit is contained in:
parent
b7fd0e648a
commit
73c7998967
2 changed files with 5 additions and 5 deletions
|
@ -427,7 +427,7 @@ int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[], char* neigh
|
|||
//return 1;
|
||||
}
|
||||
|
||||
if (dawn_metric.use_station_count && own_score == score_to_compare && score_to_compare > max_score) {
|
||||
if (dawn_metric.use_station_count > 0 && own_score == score_to_compare && score_to_compare > max_score) {
|
||||
|
||||
// only compare if score is bigger or equal 0
|
||||
if (own_score >= 0) {
|
||||
|
@ -1421,4 +1421,4 @@ void print_ap_array() {
|
|||
print_ap_entry(ap_array[i]);
|
||||
}
|
||||
printf("------------------\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,15 +358,15 @@ static int decide_function(probe_entry *prob_req, int req_type) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (req_type == REQ_TYPE_PROBE && !dawn_metric.eval_probe_req) {
|
||||
if (req_type == REQ_TYPE_PROBE && dawn_metric.eval_probe_req <= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (req_type == REQ_TYPE_AUTH && !dawn_metric.eval_auth_req) {
|
||||
if (req_type == REQ_TYPE_AUTH && dawn_metric.eval_auth_req <= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (req_type == REQ_TYPE_ASSOC && !dawn_metric.eval_assoc_req) {
|
||||
if (req_type == REQ_TYPE_ASSOC && dawn_metric.eval_assoc_req <= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue