[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220112173529.765170-2-miquel.raynal@bootlin.com>
Date: Wed, 12 Jan 2022 18:35:23 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Alexander Aring <alex.aring@...il.com>,
Stefan Schmidt <stefan@...enfreihafen.org>,
linux-wpan@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc: David Girault <david.girault@...vo.com>,
Romuald Despres <romuald.despres@...vo.com>,
Frederic Blain <frederic.blain@...vo.com>,
Nicolas Schodet <nico@...fr.eu.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-wireless@...r.kernel.org,
Romuald Despres <Romuald.Despres@...vo.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [wpan-tools v2 1/7] iwpan: Fix the channels printing
From: Romuald Despres <Romuald.Despres@...vo.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@...vo.com>
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
---
src/info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.27.0
Powered by blists - more mailing lists