Commit 65aca068 authored by Filip Matusiak's avatar Filip Matusiak
Browse files

Channel scan: allow scan of the whole opclass

parent 6e857bf7
Pipeline #75474 passed with stages
in 9 minutes and 1 second
......@@ -2206,6 +2206,7 @@ static int cntlr_scan(struct ubus_context *ctx, struct ubus_object *obj,
strncpy(mac_str, blobmsg_data(attr), 17);
if (!hwaddr_aton(mac_str, scan_req_data.radios[i].radio_mac)) {
dbg("|%s:%d| Failed to parse radio MAC.\n", __func__, __LINE__);
return UBUS_STATUS_UNKNOWN_ERROR;
}
......@@ -2256,8 +2257,11 @@ static int cntlr_scan(struct ubus_context *ctx, struct ubus_object *obj,
k++;
}
if (k != num_radios)
return UBUS_STATUS_UNKNOWN_ERROR;
if (tb[SCAN_POLICY_CHANNEL] && k != num_radios) {
dbg("|%s:%d| number of elements in radio & channel arrays differ.\n",
__func__, __LINE__);
return UBUS_STATUS_INVALID_ARGUMENT;
}
/* Opclasses (cur - current opclass id) */
k = 0;
......@@ -2274,6 +2278,15 @@ static int cntlr_scan(struct ubus_context *ctx, struct ubus_object *obj,
k++;
}
if (tb[SCAN_POLICY_CLASSID] && k != num_radios) {
dbg("|%s:%d| number of elements in radio & opclass arrays differ.\n",
__func__, __LINE__);
return UBUS_STATUS_INVALID_ARGUMENT;
}
trace("%s: Sending channel scan request to the agent " MACFMT ".\n",
__func__, MAC2STR(agent_mac));
ret = cntlr_send_channel_scan_request(c, agent_mac, &scan_req_data);
return ret;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment