summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorMartin Weinelt <martin@linuxlounge.net>2019-02-06 15:39:14 +0100
committerSimon Wunderlich <sw@simonwunderlich.de>2019-02-06 19:42:52 +0100
commit5f320f09b3d93200eb61eb9a26e1d2b3078eb712 (patch)
treee479f29d834c33da095b38272e8e575dc3dc5c22 /net/batman-adv
parentbatman-adv: Update copyright years for 2019 (diff)
downloadlinux-5f320f09b3d93200eb61eb9a26e1d2b3078eb712.tar.xz
linux-5f320f09b3d93200eb61eb9a26e1d2b3078eb712.zip
batman-adv: fix memory leak in in batadv_dat_put_dhcp
batadv_dat_put_dhcp is creating a new ARP packet via batadv_dat_arp_create_reply and tries to forward it via batadv_dat_send_data to different peers in the DHT. The original skb is not consumed by batadv_dat_send_data and thus has to be consumed by the caller. Fixes: b61ec31c8575 ("batman-adv: Snoop DHCPACKs for DAT") Signed-off-by: Martin Weinelt <martin@linuxlounge.net> [sven@narfation.org: add commit message] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/distributed-arp-table.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index 899ab051ffce..310a4f353008 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1711,6 +1711,8 @@ static void batadv_dat_put_dhcp(struct batadv_priv *bat_priv, u8 *chaddr,
batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT);
batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
+ consume_skb(skb);
+
batadv_dbg(BATADV_DBG_DAT, bat_priv,
"Snooped from outgoing DHCPACK (server address): %pI4, %pM (vid: %i)\n",
&ip_dst, hw_dst, batadv_print_vid(vid));