net: mac802154: Avoid displaying misleading debug information
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 5 Sep 2022 20:27:24 +0000 (22:27 +0200)
committerStefan Schmidt <stefan@datenfreihafen.org>
Wed, 12 Oct 2022 11:04:51 +0000 (13:04 +0200)
commit3a22550ab50a2bed1779c7d03c9f0239d33cc514
tree6092607770ad9ce2550c09cc321def66f96ccee2
parent0218277df5a527c9e9474aa0e4e4e2f4bbc6f5cc
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>
net/mac802154/rx.c