Skip to content
Snippets Groups Projects
Commit afc25c52 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

dynbhd: use base 10 for stroul when reading mid

parent cdf31e4c
Branches
No related tags found
1 merge request!742Dynbh oper state
...@@ -186,10 +186,8 @@ static void bridge_readd(atimer_t *t) ...@@ -186,10 +186,8 @@ static void bridge_readd(atimer_t *t)
/* callback to send ap autoconfig search */ /* callback to send ap autoconfig search */
static void send_apconf_cb(atimer_t *t) static void send_apconf_cb(atimer_t *t)
{ {
struct ethport *ap = container_of(t, struct ethport, struct ethport *ap = container_of(t, struct ethport, send_apconf);
send_apconf);
char mid[16] = {0}; char mid[16] = {0};
char *endptr = NULL;
fprintf(stderr, "|%s:%d| sending query num %d for ifname:%s alid:%s \n", __func__, __LINE__, (ap->num_mid+1), ap->ifname, ap->ctx->alidstr); fprintf(stderr, "|%s:%d| sending query num %d for ifname:%s alid:%s \n", __func__, __LINE__, (ap->num_mid+1), ap->ifname, ap->ctx->alidstr);
runCmd("[ -n \"$(ubus list ieee1905.al.%s)\" ] || ubus call ieee1905 add_interface '{\"ifname\":\"%s\"}'", ap->ifname, ap->ifname); runCmd("[ -n \"$(ubus list ieee1905.al.%s)\" ] || ubus call ieee1905 add_interface '{\"ifname\":\"%s\"}'", ap->ifname, ap->ifname);
...@@ -201,12 +199,12 @@ ubus call ieee1905 cmdu '{"ifname":"eth0", "dst":"01:80:C2:00:00:13", "type":7, ...@@ -201,12 +199,12 @@ ubus call ieee1905 cmdu '{"ifname":"eth0", "dst":"01:80:C2:00:00:13", "type":7,
runCmd("ubus list ieee1905.al.%s", ap->ifname); runCmd("ubus list ieee1905.al.%s", ap->ifname);
fprintf(stderr, "mid = %s\n", mid); fprintf(stderr, "mid = %s\n", mid);
errno = 0; errno = 0;
ap->mid[ap->num_mid] = (uint16_t) strtol(mid, &endptr, 16); ap->mid[ap->num_mid] = (uint16_t) strtoul(mid, NULL, 10);
if (errno || *endptr != '\0') { if (errno) {
fprintf(stderr, "Invalid mid value: %s\n", mid); fprintf(stderr, "Invalid mid value: %s\n", mid);
ap->mid[ap->num_mid] = 0; ap->mid[ap->num_mid] = 0;
} }
fprintf(stderr, "mid[%d] = %d\n", ap->num_mid, ap->mid[ap->num_mid]); fprintf(stderr, "mid[%d] = %u\n", ap->num_mid, ap->mid[ap->num_mid]);
if (ap->num_mid < 31) if (ap->num_mid < 31)
ap->num_mid++; ap->num_mid++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment