Commit 748b1626 authored by Anjan Chanda's avatar Anjan Chanda

use correct wifi_get_sta_info() return value

parent dcb0ee9d
Pipeline #467 passed with stage
in 22 seconds
......@@ -852,7 +852,7 @@ static int wl_dump_stations(struct blob_buf *bb, const char *ifname,
continue;
memset(&sx, 0, sizeof(sx));
if (!wifi_get_sta_info(ifname, sta, &sx))
if (wifi_get_sta_info(ifname, sta, &sx))
continue;
wifi_get_channel(ifname, &channel, &bw);
......@@ -1173,14 +1173,12 @@ static int wl_autochannel(struct ubus_context *ctx, struct ubus_object *obj,
/* list neighbors policy */
enum {
NBR_LIST_IFNAME,
NBR_LIST_SSID, /* ssid filter */
NBR_LIST_CLIENT, /* from beacon report by client */
__NBR_LIST_MAX,
};
static const struct blobmsg_policy nbr_list_policy[__NBR_LIST_MAX] = {
[NBR_LIST_IFNAME] = { .name = "vif", .type = BLOBMSG_TYPE_STRING },
[NBR_LIST_SSID] = { .name = "ssid", .type = BLOBMSG_TYPE_STRING },
[NBR_LIST_CLIENT] = { .name = "client", .type = BLOBMSG_TYPE_STRING },
};
......@@ -1448,11 +1446,19 @@ static int nbr_del(struct ubus_context *ctx, struct ubus_object *obj,
static int _nbr_list(struct blob_buf *bb, const char *ifname, bool wildcard)
{
struct nbr *nbr;
int nr;
int nr = 16;
void *a, *t;
char bssid_str[18] = {0};
int i;
char *data;
data = calloc(nr, sizeof(struct nbr));
if (!data) {
fprintf(stderr, "OOM get_neighbor_list()\n");
return UBUS_STATUS_UNKNOWN_ERROR;
}
nbr = (struct nbr *)data;
if (wifi_get_neighbor_list(ifname, &nbr, &nr) < 0)
return -1;
......
Markdown is supported
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