9d9dc8ddf6c22a3f9a6fffdbc38c8d07b9023fae
[feed/routing.git] / batman-adv / patches / 0012-batman-adv-free-skb-on-TVLV-parsing-success.patch
1 From 9289542085d7e298b90c7b6fb6efb509dab69d8b Mon Sep 17 00:00:00 2001
2 From: Antonio Quartulli <antonio@open-mesh.com>
3 Date: Tue, 11 Feb 2014 17:05:07 +0100
4 Subject: [PATCH 12/13] batman-adv: free skb on TVLV parsing success
5
6 When the TVLV parsing routine succeed the skb is left
7 untouched thus leading to a memory leak.
8
9 Fix this by consuming the skb in case of success.
10
11 Introduced by 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
12 ("batman-adv: tvlv - basic infrastructure")
13
14 Reported-by: Russel Senior <russell@personaltelco.net>
15 Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
16 Tested-by: Russell Senior <russell@personaltelco.net>
17 Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
18 ---
19 routing.c | 2 ++
20 1 file changed, 2 insertions(+)
21
22 diff --git a/routing.c b/routing.c
23 index f7579d0..71bf698 100644
24 --- a/routing.c
25 +++ b/routing.c
26 @@ -1063,6 +1063,8 @@ int batadv_recv_unicast_tvlv(struct sk_buff *skb,
27
28 if (ret != NET_RX_SUCCESS)
29 ret = batadv_route_unicast_packet(skb, recv_if);
30 + else
31 + consume_skb(skb);
32
33 return ret;
34 }
35 --
36 1.9.0.rc3
37