aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_tunnel.c
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2014-02-20 04:19:31 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-20 13:13:50 -0500
commitcf71d2bc0b8a473209d5c770ce560853bd720d14 (patch)
tree9ecc5d5a3f3c0bb44a5f82a238f427291efef702 /net/ipv4/ip_tunnel.c
parent6671b2240c54585d4afb5286a29f1569fe5e40a8 (diff)
sit: fix panic with route cache in ip tunnels
Bug introduced by commit 7d442fab0a67 ("ipv4: Cache dst in tunnels"). Because sit code does not call ip_tunnel_init(), the dst_cache was not initialized. CC: Tom Herbert <therbert@google.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_tunnel.c')
-rw-r--r--net/ipv4/ip_tunnel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 08f8cf99b3a2..78a89e61925d 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -93,13 +93,14 @@ static void tunnel_dst_reset(struct ip_tunnel *t)
93 tunnel_dst_set(t, NULL); 93 tunnel_dst_set(t, NULL);
94} 94}
95 95
96static void tunnel_dst_reset_all(struct ip_tunnel *t) 96void ip_tunnel_dst_reset_all(struct ip_tunnel *t)
97{ 97{
98 int i; 98 int i;
99 99
100 for_each_possible_cpu(i) 100 for_each_possible_cpu(i)
101 __tunnel_dst_set(per_cpu_ptr(t->dst_cache, i), NULL); 101 __tunnel_dst_set(per_cpu_ptr(t->dst_cache, i), NULL);
102} 102}
103EXPORT_SYMBOL(ip_tunnel_dst_reset_all);
103 104
104static struct rtable *tunnel_rtable_get(struct ip_tunnel *t, u32 cookie) 105static struct rtable *tunnel_rtable_get(struct ip_tunnel *t, u32 cookie)
105{ 106{
@@ -713,7 +714,7 @@ static void ip_tunnel_update(struct ip_tunnel_net *itn,
713 if (set_mtu) 714 if (set_mtu)
714 dev->mtu = mtu; 715 dev->mtu = mtu;
715 } 716 }
716 tunnel_dst_reset_all(t); 717 ip_tunnel_dst_reset_all(t);
717 netdev_state_change(dev); 718 netdev_state_change(dev);
718} 719}
719 720
@@ -1042,7 +1043,7 @@ void ip_tunnel_uninit(struct net_device *dev)
1042 if (itn->fb_tunnel_dev != dev) 1043 if (itn->fb_tunnel_dev != dev)
1043 ip_tunnel_del(netdev_priv(dev)); 1044 ip_tunnel_del(netdev_priv(dev));
1044 1045
1045 tunnel_dst_reset_all(tunnel); 1046 ip_tunnel_dst_reset_all(tunnel);
1046} 1047}
1047EXPORT_SYMBOL_GPL(ip_tunnel_uninit); 1048EXPORT_SYMBOL_GPL(ip_tunnel_uninit);
1048 1049