local-node: don't read pointer after clear
authorDavid Bauer <mail@david-bauer.net>
Tue, 21 Sep 2021 16:51:57 +0000 (18:51 +0200)
committerDavid Bauer <mail@david-bauer.net>
Tue, 21 Sep 2021 17:46:05 +0000 (19:46 +0200)
commit8c35c8e6a00d8d4fc5e78987e7aa61f93a110e89
tree9ea8254cabfcc2c391400d7953c2c5a1f2b3b25b
parente4ea2045ebaac63e663765b29178241932322406
local-node: don't read pointer after clear

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>
local_node.c