Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit a58feb79ed1447e3e83f3b0b1a23779886869f39 Author: Andreas Pape apape@phoenixcontact.com Date: Fri May 19 10:01:42 2017 +0200
batman-adv: fix memory leak when dropping packet from other gateway
The skb must be released in the receive handler since b91a2543b4c1 ("batman-adv: Consume skb in receive handlers"). Just returning NET_RX_DROP will no longer automatically free the memory. This results in memory leaks when unicast packets from other backbones must be dropped because they share a common backbone.
Fixes: bfe2a1971f43 ("batman-adv: drop unicast packets from other backbone gw") Signed-off-by: Andreas Pape apape@phoenixcontact.com [sven@narfation.org: adjust commit message] Signed-off-by: Sven Eckelmann sven@narfation.org
a58feb79ed1447e3e83f3b0b1a23779886869f39 net/batman-adv/routing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index e1ebe14..ae9f4d3 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -987,7 +987,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, batadv_dbg(BATADV_DBG_BLA, bat_priv, "recv_unicast_packet(): Dropped unicast pkt received from another backbone gw %pM.\n", orig_addr_gw); - return NET_RX_DROP; + goto free_skb; } }