[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1402420995.3645.435.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 10 Jun 2014 10:23:15 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Phoebe Buckheister <phoebe.buckheister@...m.fraunhofer.de>
Cc: netdev@...r.kernel.org, linux-zigbee-devel@...ts.sourceforge.net,
davem@...emloft.net
Subject: Re: [PATCH v2 net-next 2/2] mac802154: don't deliver packets to
devices that are down
On Tue, 2014-06-10 at 18:11 +0200, Phoebe Buckheister wrote:
> Only one WPAN devices can be active at any given time, so only deliver
> packets to that one interface that is actually up. Multiple monitors may
> be up at any given time, but we don't have to deliver to monitors that
> are down either.
> diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
> index 0597b96..46440b9 100644
> --- a/net/mac802154/rx.c
> +++ b/net/mac802154/rx.c
> @@ -64,19 +64,22 @@ mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb, u8 lqi)
>
> if (skb->len < 2) {
> pr_debug("got invalid frame\n");
> - goto out;
> + goto fail;
> }
> crc = crc_ccitt(0, skb->data, skb->len);
> if (crc) {
> pr_debug("CRC mismatch\n");
> - goto out;
> + goto fail;
> }
> skb_trim(skb, skb->len - 2); /* CRC */
> }
>
> mac802154_monitors_rx(priv, skb);
> mac802154_wpans_rx(priv, skb);
> -out:
> +
> + return;
> +
> +fail:
> dev_kfree_skb(skb);
This should be kfree_skb(), because we drop the packet, and should be
drop_monitor friendly
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists