From patchwork Fri Jul 22 17:18:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "'arozansk@redhat.com'" X-Patchwork-Id: 9243863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98F4960756 for ; Fri, 22 Jul 2016 17:18:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8989527F9A for ; Fri, 22 Jul 2016 17:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DAC927FA8; Fri, 22 Jul 2016 17:18:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C3FF27FAB for ; Fri, 22 Jul 2016 17:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752355AbcGVRSY (ORCPT ); Fri, 22 Jul 2016 13:18:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34700 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638AbcGVRSX (ORCPT ); Fri, 22 Jul 2016 13:18:23 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 314A878EA1; Fri, 22 Jul 2016 17:18:23 +0000 (UTC) Received: from napanee.usersys.redhat.com (dhcp-17-12.bos.redhat.com [10.18.17.12]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6MHIM6m008091; Fri, 22 Jul 2016 13:18:22 -0400 Received: by napanee.usersys.redhat.com (Postfix, from userid 1000) id E415AC0801; Fri, 22 Jul 2016 13:18:21 -0400 (EDT) From: Aristeu Rozanski To: linux-wpan@vger.kernel.org Cc: Alexander Aring , Stefan Schmidt , Jukka Rissanen , Aristeu Rozanski Subject: [PATCH 1/3] mac802154: don't warn on unsupported frames Date: Fri, 22 Jul 2016 13:18:14 -0400 Message-Id: <1469207896-26481-1-git-send-email-arozansk@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 22 Jul 2016 17:18:23 +0000 (UTC) Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }