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:
twy_2000 2020-05-20 16:11:14 +08:00 committed by Polynomialdivision
parent b7fd0e648a
commit 73c7998967
2 changed files with 5 additions and 5 deletions

View file

@ -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;
}