ipv6: release dst properly in ipip6_tunnel_xmit
Subsystems (2)
PATCH 1/1 ipv6: release dst properly in ipip6_tunnel_xmit
From: Li RongQing <[email protected]>
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 <[email protected]>
--- net/ipv6/sit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv6/sit.c +3 -1
@@ -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)));
Signature · 1 line
1.7.10.4
Quoted 16 lines · On Fri, 2013-12-20 at 17:20 +0800, [email protected] wrote:
From: Li RongQing <[email protected]>
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 <[email protected]>--- net/ipv6/sit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/ipv6/sit.c +0
-0@@ -966,8 +966,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, tos =INET_ECN_encapsulate (tos,ipv6_get_dsfield (iph6));
net/ipv6/sit.c static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, · line 975
Quoted 10 lines
net/ipv6/sit.c +3
-1skb =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)));
Fixes 61c1db7fae21 ("ipv6: sit: add GSO/TSO support")
Acked-by Eric Dumazet <[email protected]>
Thanks a lot !
From: Eric Dumazet <[email protected]>
Date: Fri, 20 Dec 2013 06:16:46 -0800
Quoted 7 lines · On Fri, 2013-12-20 at 17:20 +0800, [email protected] wrote:
Quoted 6 lines
From: Li RongQing <[email protected]>
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 <[email protected]>
...
Quoted 2 lines
Fixes 61c1db7fae21 ("ipv6: sit: add GSO/TSO support")Acked-by Eric Dumazet <[email protected]>
Applied, thanks everyone.