diff mbox series

[wpan-tools,1/7] iwpan: Fix the channels printing

Message ID 20220701143434.1267864-2-miquel.raynal@bootlin.com (mailing list archive)
State New, archived
Headers show
Series iwpan: Support scanning/beaconing | expand

Commit Message

Miquel Raynal July 1, 2022, 2:34 p.m. UTC
From: Romuald Despres <Romuald.Despres@qorvo.com>

The presence of a channel capability is checked against the tb_msg
netlink attributes array which is the root one, while here we are
looking for channel capabilities, themselves being nested and parsed
into tb_caps. Use tb_caps instead of tb_msg here otherwise we are
accessing a random index in the upper attributes list.

Signed-off-by: Romuald Despres <Romuald.Despres@qorvo.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
 src/info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/src/info.c b/src/info.c
index f85690c..8ed5e4f 100644
--- a/src/info.c
+++ b/src/info.c
@@ -342,7 +342,7 @@  static int print_phy_handler(struct nl_msg *msg, void *arg)
 			printf("\b \n");
-		if (tb_msg[NL802154_CAP_ATTR_CHANNELS]) {
+		if (tb_caps[NL802154_CAP_ATTR_CHANNELS]) {
 			int counter = 0;
 			int rem_pages;
 			struct nlattr *nl_pages;