All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mac802154: don't warn on unsupported frames
@ 2016-07-22 17:18 Aristeu Rozanski
  2016-07-22 17:18 ` [PATCH 2/3] mac802154: use rate limited warnings for malformed frames Aristeu Rozanski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Aristeu Rozanski @ 2016-07-22 17:18 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, Stefan Schmidt, Jukka Rissanen, Aristeu Rozanski

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.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
---
 net/mac802154/rx.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 446e130..d388bf2 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -82,6 +82,7 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
 		break;
 	default:
 		pr_debug("invalid dest mode\n");
+		sdata->dev->stats.rx_frame_errors++;
 		goto fail;
 	}
 
@@ -97,15 +98,22 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
 		goto fail;
 	}
 
-	sdata->dev->stats.rx_packets++;
-	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:
+		sdata->dev->stats.rx_dropped++;
+		goto fail;
+
 	case IEEE802154_FC_TYPE_DATA:
+		sdata->dev->stats.rx_bytes += skb->len;
+		sdata->dev->stats.rx_packets++;
 		return ieee802154_deliver_skb(skb);
+
 	default:
 		pr_warn("ieee802154: bad frame received (type = %d)\n",
 			mac_cb(skb)->type);
+		sdata->dev->stats.rx_frame_errors++;
 		goto fail;
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-25 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 17:18 [PATCH 1/3] mac802154: don't warn on unsupported frames Aristeu Rozanski
2016-07-22 17:18 ` [PATCH 2/3] mac802154: use rate limited warnings for malformed frames Aristeu Rozanski
2016-07-23 12:48   ` Alexander Aring
2016-07-24 16:45   ` Marcel Holtmann
2016-07-22 17:18 ` [PATCH 3/3] ieee802154: encrypt frame before ieee802154_subif_start_xmit is called Aristeu Rozanski
2016-07-23 13:43   ` Alexander Aring
2016-07-25 13:38     ` Aristeu Rozanski
2016-07-23 12:46 ` [PATCH 1/3] mac802154: don't warn on unsupported frames Alexander Aring
2016-07-25 13:15   ` Aristeu Rozanski

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.