Skip to contentSkip to conversation

mac802154: don't warn on unsupported frames

PATCH In review Aristeu Rozanski 3 participants 6 messages Jul 25, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 mac802154: don't warn on unsupported frames

Just because we don't support certain types of frames yet doesn't mean we have to flood the message log with warnings about "invalid" frames.

v2: get rid of stats update, some of them were wrong, others might change in
the future

---
 net/mac802154/rx.c | 5 +++++
 1 file changed, 5 insertions(+)
net/mac802154/rx.c +5 -0
index 446e130..b978da0 100644
@@ -101,6 +101,11 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
 	sdata->dev->stats.rx_bytes += skb->len;
 
 	switch (mac_cb(skb)->type) {
+	case IEEE802154_FC_TYPE_BEACON:
+	case IEEE802154_FC_TYPE_ACK:
+	case IEEE802154_FC_TYPE_MAC_CMD:
+		goto fail;
+
 	case IEEE802154_FC_TYPE_DATA:
 		return ieee802154_deliver_skb(skb);
 	default:
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 2/2 mac802154: use rate limited warnings for malformed frames

v2: rediff on top of previous v2

---
 net/mac802154/rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/mac802154/rx.c +2 -2
index b978da0..4dcf6e1 100644
@@ -109,8 +109,8 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
 	case IEEE802154_FC_TYPE_DATA:
 		return ieee802154_deliver_skb(skb);
 	default:
-		pr_warn("ieee802154: bad frame received (type = %d)\n",
-			mac_cb(skb)->type);
+		pr_warn_ratelimited("ieee802154: bad frame received "
+				    "(type = %d)\n", mac_cb(skb)->type);
 		goto fail;
 	}
 
Signature · 1 line
1.8.3.1
#5 lore raw
In reply to Aristeu Rozanski

Hi Aristeu,

Quoted 10 lines

Just because we don't support certain types of frames yet doesn't mean we have to flood the message log with warnings about "invalid" frames.

v2: get rid of stats update, some of them were wrong, others might change in
the future

---
net/mac802154/rx.c | 5 +++++

1 file changed, 5 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel