All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	linux-wpan@vger.kernel.org
Cc: David Girault <david.girault@qorvo.com>,
	Romuald Despres <romuald.despres@qorvo.com>,
	Frederic Blain <frederic.blain@qorvo.com>,
	Nicolas Schodet <nico@ni.fr.eu.org>,
	Guilhem Imberton <guilhem.imberton@qorvo.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Romuald Despres <Romuald.Despres@qorvo.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH wpan-tools v2 2/8] iwpan: Fix the channels printing
Date: Fri,  6 Jan 2023 12:18:25 +0100	[thread overview]
Message-ID: <20230106111831.692202-3-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20230106111831.692202-1-miquel.raynal@bootlin.com>

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 --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.34.1


  parent reply	other threads:[~2023-01-06 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 11:18 [PATCH wpan-tools v2 0/8] iwpan: Scan support Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 1/8] iwpan: Synchronize nl802154.h with the latest kernel Miquel Raynal
2023-01-06 11:18 ` Miquel Raynal [this message]
2023-01-06 11:18 ` [PATCH wpan-tools v2 3/8] iwpan: Export iwpan_debug Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 4/8] iwpan: Fix a comment Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 5/8] iwpan: Remove duplicated SECTION Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 6/8] iwpan: Synchronize nl802154.h with the latest scan changes Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 7/8] iwpan: Add scan support Miquel Raynal
2023-01-06 11:18 ` [PATCH wpan-tools v2 8/8] iwpan: Add events support Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230106111831.692202-3-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=david.girault@qorvo.com \
    --cc=frederic.blain@qorvo.com \
    --cc=guilhem.imberton@qorvo.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=nico@ni.fr.eu.org \
    --cc=romuald.despres@qorvo.com \
    --cc=stefan@datenfreihafen.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.