]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
authorDuan Jiong <duanj.fnst@cn.fujitsu.com>
Thu, 23 Jan 2014 06:00:25 +0000 (14:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jan 2014 21:23:16 +0000 (13:23 -0800)
commit a622260254ee48("ip_tunnel: fix kernel panic with icmp_dest_unreach")
clear IPCB in ip_tunnel_xmit()  , or else skb->cb[] may contain garbage from
GSO segmentation layer.

But commit 0e6fbc5b6c621("ip_tunnels: extend iptunnel_xmit()") refactor codes,
and it clear IPCB behind the dst_link_failure().

So clear IPCB in ip_tunnel_xmit() just like commti a622260254ee48("ip_tunnel:
fix kernel panic with icmp_dest_unreach").

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel.c

index 1886cd40a3f6f44d6f63df50c44465415f0a6e45..c0e3cb72ad70ad211f4801e13c5e207dc48318e3 100644 (file)
@@ -686,6 +686,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
                                tunnel->err_time + IPTUNNEL_ERR_TIMEO)) {
                        tunnel->err_count--;
 
+                       memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
                        dst_link_failure(skb);
                } else
                        tunnel->err_count = 0;