All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Cc: netdev@vger.kernel.org, linux-zigbee-devel@lists.sourceforge.net,
	davem@davemloft.net
Subject: Re: [PATCH net-next 2/2] mac802154: don't deliver packets to devices that are down
Date: Tue, 10 Jun 2014 08:26:01 -0700	[thread overview]
Message-ID: <1402413961.3645.432.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <1402412922-14180-3-git-send-email-phoebe.buckheister@itwm.fraunhofer.de>

On Tue, 2014-06-10 at 17:08 +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.
> 
> Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
> ---
>  net/mac802154/wpan.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
> index c8cfd54..1ba648e 100644
> --- a/net/mac802154/wpan.c
> +++ b/net/mac802154/wpan.c
> @@ -567,7 +567,6 @@ static int mac802154_parse_frame_start(struct sk_buff *skb,
>  void mac802154_wpans_rx(struct mac802154_priv *priv, struct sk_buff *skb)
>  {
>  	int ret;
> -	struct sk_buff *sskb;
>  	struct mac802154_sub_if_data *sdata;
>  	struct ieee802154_hdr hdr;
>  
> @@ -579,12 +578,15 @@ void mac802154_wpans_rx(struct mac802154_priv *priv, struct sk_buff *skb)
>  
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(sdata, &priv->slaves, list) {
> -		if (sdata->type != IEEE802154_DEV_WPAN)
> +		if (sdata->type != IEEE802154_DEV_WPAN ||
> +		    !netif_running(sdata->dev))
>  			continue;
>  
> -		sskb = skb_clone(skb, GFP_ATOMIC);
> -		if (sskb)
> -			mac802154_subif_frame(sdata, sskb, &hdr);
> +		skb = skb_clone(skb, GFP_ATOMIC);
> +		if (skb)
> +			mac802154_subif_frame(sdata, skb, &hdr);
> +
> +		break;
>  	}
>  	rcu_read_unlock();
>  }

If this is really the case, do not clone the skb, and fix
mac802154_subif_rx().

(mac802154_wpans_rx() would always consume the skb)

  reply	other threads:[~2014-06-10 15:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 15:08 [PATCH net-next] some mac802154 fixes Phoebe Buckheister
     [not found] ` <1402412922-14180-1-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2014-06-10 15:08   ` [PATCH net-next 1/2] mac802154: properly free incoming skbs on decryption failure Phoebe Buckheister
2014-06-10 15:08   ` [PATCH net-next 2/2] mac802154: don't deliver packets to devices that are down Phoebe Buckheister
2014-06-10 15:26     ` Eric Dumazet [this message]
2014-06-10 15:32       ` Phoebe Buckheister

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402413961.3645.432.camel@edumazet-glaptop2.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-zigbee-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=phoebe.buckheister@itwm.fraunhofer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.