public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: free skb when dropping broadcast packet received from another backbone gw
@ 2016-02-12 13:54 Andreas Pape
  2016-02-15  8:18 ` Simon Wunderlich
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Pape @ 2016-02-12 13:54 UTC (permalink / raw)
  To: b.a.t.m.a.n

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;
+       }

        if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
hdr_size))
                goto rx_success;
--
1.7.0.4



..................................................................
PHOENIX CONTACT ELECTRONICS GmbH

Sitz der Gesellschaft / registered office of the company: 31812 Bad Pyrmont
USt-Id-Nr.: DE811742156
Amtsgericht Hannover HRB 100528 / district court Hannover HRB 100528
Geschäftsführer / Executive Board: Roland Bent, Dr. Martin Heubeck
___________________________________________________________________
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
----------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
___________________________________________________________________

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

* Re: [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: free skb when dropping broadcast packet received from another backbone gw
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Wunderlich @ 2016-02-15  8:18 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- 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 --]

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

end of thread, other threads:[~2016-02-15  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox