summaryrefslogtreecommitdiff
path: root/net/mac802154
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2022-09-05 23:27:24 +0300
committerStefan Schmidt <stefan@datenfreihafen.org>2022-10-12 14:04:51 +0300
commit3a22550ab50a2bed1779c7d03c9f0239d33cc514 (patch)
tree6092607770ad9ce2550c09cc321def66f96ccee2 /net/mac802154
parent0218277df5a527c9e9474aa0e4e4e2f4bbc6f5cc (diff)
downloadlinux-3a22550ab50a2bed1779c7d03c9f0239d33cc514.tar.xz
net: mac802154: Avoid displaying misleading debug information
With DEBUG defined, any frame received will see its MHR fields (fc and addresses, mainly) being printed in the kernel log buffer, unconditionally. In most cases this is fine, but in some specific cases (like Acknowledgment frames, where both the source and destination addressing fields are omitted), it displays garbage which is misleading. Only print the addressing fields when they are present, which clarifies the logs. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20220905202724.1322046-1-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/rx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 6640bd237352..d1f7b8df41fe 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -114,8 +114,10 @@ fail:
static void
ieee802154_print_addr(const char *name, const struct ieee802154_addr *addr)
{
- if (addr->mode == IEEE802154_ADDR_NONE)
+ if (addr->mode == IEEE802154_ADDR_NONE) {
pr_debug("%s not present\n", name);
+ return;
+ }
pr_debug("%s PAN ID: %04x\n", name, le16_to_cpu(addr->pan_id));
if (addr->mode == IEEE802154_ADDR_SHORT) {