[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387531212-17034-1-git-send-email-roy.qing.li@gmail.com>
Date: Fri, 20 Dec 2013 17:20:12 +0800
From: roy.qing.li@...il.com
To: netdev@...r.kernel.org
Subject: [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit
From: Li RongQing <roy.qing.li@...il.com>
if a dst is not attached to anywhere, it should be released before
exit ipip6_tunnel_xmit, otherwise cause dst memory leakage.
Signed-off-by: Li RongQing <roy.qing.li@...il.com>
---
net/ipv6/sit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 366fbba..d68a224 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -966,8 +966,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
skb = iptunnel_handle_offloads(skb, false, SKB_GSO_SIT);
- if (IS_ERR(skb))
+ if (IS_ERR(skb)) {
+ ip_rt_put(rt);
goto out;
+ }
err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos,
ttl, df, !net_eq(tunnel->net, dev_net(dev)));
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists