diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2013-12-20 10:20:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-27 19:14:40 +0100 |
commit | 6a9eadccff2926e392173a989042f14c867cffbf (patch) | |
tree | 1aedee4f6e03d14cb30657370aff6a96edf09193 /net/ipv6/sit.c | |
parent | netxen: Correct off-by-one errors in bounds checks (diff) | |
download | linux-6a9eadccff2926e392173a989042f14c867cffbf.tar.xz linux-6a9eadccff2926e392173a989042f14c867cffbf.zip |
ipv6: release dst properly in ipip6_tunnel_xmit
if a dst is not attached to anywhere, it should be released before
exit ipip6_tunnel_xmit, otherwise cause dst memory leakage.
Fixes: 61c1db7fae21 ("ipv6: sit: add GSO/TSO support")
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index a710fdec42d3..c87482252577 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))); |