diff options
Diffstat (limited to 'net/ipv4/ip_tunnel.c')
-rw-r--r-- | net/ipv4/ip_tunnel.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index e77381d1df9a..b3f859731c60 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -442,6 +442,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, | |||
442 | tunnel->i_seqno = ntohl(tpi->seq) + 1; | 442 | tunnel->i_seqno = ntohl(tpi->seq) + 1; |
443 | } | 443 | } |
444 | 444 | ||
445 | skb_reset_network_header(skb); | ||
446 | |||
445 | err = IP_ECN_decapsulate(iph, skb); | 447 | err = IP_ECN_decapsulate(iph, skb); |
446 | if (unlikely(err)) { | 448 | if (unlikely(err)) { |
447 | if (log_ecn_error) | 449 | if (log_ecn_error) |
@@ -670,7 +672,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
670 | return; | 672 | return; |
671 | } | 673 | } |
672 | 674 | ||
673 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, | 675 | err = iptunnel_xmit(skb->sk, rt, skb, fl4.saddr, fl4.daddr, protocol, |
674 | tos, ttl, df, !net_eq(tunnel->net, dev_net(dev))); | 676 | tos, ttl, df, !net_eq(tunnel->net, dev_net(dev))); |
675 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 677 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |
676 | 678 | ||
@@ -722,19 +724,18 @@ static void ip_tunnel_update(struct ip_tunnel_net *itn, | |||
722 | int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd) | 724 | int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd) |
723 | { | 725 | { |
724 | int err = 0; | 726 | int err = 0; |
725 | struct ip_tunnel *t; | 727 | struct ip_tunnel *t = netdev_priv(dev); |
726 | struct net *net = dev_net(dev); | 728 | struct net *net = t->net; |
727 | struct ip_tunnel *tunnel = netdev_priv(dev); | 729 | 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 | 730 | ||
730 | BUG_ON(!itn->fb_tunnel_dev); | 731 | BUG_ON(!itn->fb_tunnel_dev); |
731 | switch (cmd) { | 732 | switch (cmd) { |
732 | case SIOCGETTUNNEL: | 733 | case SIOCGETTUNNEL: |
733 | t = NULL; | 734 | 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); | 735 | t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); |
736 | if (t == NULL) | 736 | if (t == NULL) |
737 | t = netdev_priv(dev); | 737 | t = netdev_priv(dev); |
738 | } | ||
738 | memcpy(p, &t->parms, sizeof(*p)); | 739 | memcpy(p, &t->parms, sizeof(*p)); |
739 | break; | 740 | break; |
740 | 741 | ||