local-node: check correct field

This causes segfaults on OpenWrt 21.02 which is missing the op-class
field.

Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2022-02-06 23:44:30 +01:00
parent f42bf2962e
commit 6aebb75cec

View File

@@ -476,7 +476,7 @@ usteer_local_node_status_cb(struct ubus_request *req, int type, struct blob_attr
node->freq = blobmsg_get_u32(tb[MSG_FREQ]);
if (tb[MSG_CHANNEL])
node->channel = blobmsg_get_u32(tb[MSG_CHANNEL]);
if (tb[MSG_FREQ])
if (tb[MSG_OP_CLASS])
node->op_class = blobmsg_get_u32(tb[MSG_OP_CLASS]);
}