aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_tunnel.c')
-rw-r--r--net/ipv4/ip_tunnel.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index e77381d1df9a..fa5b7519765f 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -670,7 +670,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
670 return; 670 return;
671 } 671 }
672 672
673 err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, 673 err = iptunnel_xmit(skb->sk, rt, skb, fl4.saddr, fl4.daddr, protocol,
674 tos, ttl, df, !net_eq(tunnel->net, dev_net(dev))); 674 tos, ttl, df, !net_eq(tunnel->net, dev_net(dev)));
675 iptunnel_xmit_stats(err, &dev->stats, dev->tstats); 675 iptunnel_xmit_stats(err, &dev->stats, dev->tstats);
676 676
@@ -722,19 +722,18 @@ static void ip_tunnel_update(struct ip_tunnel_net *itn,
722int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd) 722int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd)
723{ 723{
724 int err = 0; 724 int err = 0;
725 struct ip_tunnel *t; 725 struct ip_tunnel *t = netdev_priv(dev);
726 struct net *net = dev_net(dev); 726 struct net *net = t->net;
727 struct ip_tunnel *tunnel = netdev_priv(dev); 727 struct ip_tunnel_net *itn = net_generic(net, t->ip_tnl_net_id);
728 struct ip_tunnel_net *itn = net_generic(net, tunnel->ip_tnl_net_id);
729 728
730 BUG_ON(!itn->fb_tunnel_dev); 729 BUG_ON(!itn->fb_tunnel_dev);
731 switch (cmd) { 730 switch (cmd) {
732 case SIOCGETTUNNEL: 731 case SIOCGETTUNNEL:
733 t = NULL; 732 if (dev == itn->fb_tunnel_dev) {
734 if (dev == itn->fb_tunnel_dev)
735 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); 733 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type);
736 if (t == NULL) 734 if (t == NULL)
737 t = netdev_priv(dev); 735 t = netdev_priv(dev);
736 }
738 memcpy(p, &t->parms, sizeof(*p)); 737 memcpy(p, &t->parms, sizeof(*p));
739 break; 738 break;
740 739