All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: free skb when dropping broadcast packet received from another backbone gw
Date: Mon, 15 Feb 2016 09:18:07 +0100	[thread overview]
Message-ID: <2708667.9PEbVjxvIc@prime> (raw)
In-Reply-To: <OF4C91F5B8.1DBDF49E-ONC1257F57.004C552D-C1257F57.004C60E3@phoenixcontact.com>

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

Hi Andreas,

On Friday 12 February 2016 14:54:15 Andreas Pape wrote:
> From 1cf69fc5b7ffac3193ad8fa4439586c865c5acab Mon Sep 17 00:00:00 2001
> From: Andreas Pape <apape@phoenixcontact.com>
> Date: Fri, 12 Feb 2016 14:00:53 +0100
> Subject: [PATCH 4/4] batman-adv: free skb when dropping broadcast packet
> received from another backbone gw
> 
> skb should be freed in batadv_recv_bcast_packet if packet shall be dropped
> due to
> reception from another backbone gateway of the same backbone.
> 
> Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
> ---
>  net/batman-adv/routing.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
> index 4dd646a..128ed28 100644
> --- a/net/batman-adv/routing.c
> +++ b/net/batman-adv/routing.c
> @@ -1104,8 +1104,10 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
>         /* don't hand the broadcast up if it is from an originator
>          * from the same backbone.
>          */
> -       if (batadv_bla_is_backbone_gw(skb, orig_node, hdr_size))
> -               goto out;
> +       if (batadv_bla_is_backbone_gw(skb, orig_node, hdr_size)) {
> +               kfree_skb(skb);
> +               goto rx_success;
> +       }

I disagree. In the original code, we return NET_RX_DROP, which makes the 
calling code already free the skb. Check batadv_batman_skb_recv() in main.c. 

Cheers,
    Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-02-15  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 13:54 [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: free skb when dropping broadcast packet received from another backbone gw Andreas Pape
2016-02-15  8:18 ` Simon Wunderlich [this message]

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=2708667.9PEbVjxvIc@prime \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /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.