From 6aebb75cec17ced49bd8a5ea0d187349a5761644 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 6 Feb 2022 23:44:30 +0100 Subject: [PATCH] local-node: check correct field This causes segfaults on OpenWrt 21.02 which is missing the op-class field. Reported-by: John Crispin Signed-off-by: David Bauer --- local_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local_node.c b/local_node.c index 9f4a2df..03d824e 100644 --- a/local_node.c +++ b/local_node.c @@ -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]); }