The name pointer provided by ubus get's cleared after the first call to
ubus_register_subscriber in usteer_get_node. The leads to an incorrect
ifindex returned by if_nametoindex due to the 0 characters long string.
Work around this issue by reusing the interface name already stored in
the local node struct.
Fixes querying the wrong interface with netlink, resulting in incorrect
SSIDs used for the nodes.
Signed-off-by: David Bauer <mail@david-bauer.net>
ln = usteer_get_node(ctx, name);
ln->obj_id = id;
ln->iface = usteer_node_name(&ln->node) + offset;
- ln->ifindex = if_nametoindex(iface);
+ ln->ifindex = if_nametoindex(ln->iface);
blob_buf_init(&b, 0);
blobmsg_add_u32(&b, "notify_response", 1);