diff options
author | David S. Miller <davem@davemloft.net> | 2013-10-01 12:42:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-01 12:42:28 -0400 |
commit | 9cb17124687026282f93c09a4fd42e0ccd1846ce (patch) | |
tree | a96c7846cb54cc09410be45bada703e84be9d5fc | |
parent | e024bdc051ab99eafb5dd9bad87e79afc27f8a44 (diff) | |
parent | cfe4a536927c3186b7e7f9be688e7e0f62bb8ea1 (diff) |
Merge branch 'ip_tunnel'
ip_tunnel bug fixes from Steffen Klassert.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/ip_tunnel.c | 18 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel_core.c | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index d3fbad422e0e..63a6d6d6b875 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -642,13 +642,13 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
642 | 642 | ||
643 | max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) | 643 | max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) |
644 | + rt->dst.header_len; | 644 | + rt->dst.header_len; |
645 | if (max_headroom > dev->needed_headroom) { | 645 | if (max_headroom > dev->needed_headroom) |
646 | dev->needed_headroom = max_headroom; | 646 | dev->needed_headroom = max_headroom; |
647 | if (skb_cow_head(skb, dev->needed_headroom)) { | 647 | |
648 | dev->stats.tx_dropped++; | 648 | if (skb_cow_head(skb, dev->needed_headroom)) { |
649 | dev_kfree_skb(skb); | 649 | dev->stats.tx_dropped++; |
650 | return; | 650 | dev_kfree_skb(skb); |
651 | } | 651 | return; |
652 | } | 652 | } |
653 | 653 | ||
654 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, | 654 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, |
@@ -853,8 +853,10 @@ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, | |||
853 | /* FB netdevice is special: we have one, and only one per netns. | 853 | /* FB netdevice is special: we have one, and only one per netns. |
854 | * Allowing to move it to another netns is clearly unsafe. | 854 | * Allowing to move it to another netns is clearly unsafe. |
855 | */ | 855 | */ |
856 | if (!IS_ERR(itn->fb_tunnel_dev)) | 856 | if (!IS_ERR(itn->fb_tunnel_dev)) { |
857 | itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; | 857 | itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; |
858 | ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev)); | ||
859 | } | ||
858 | rtnl_unlock(); | 860 | rtnl_unlock(); |
859 | 861 | ||
860 | return PTR_RET(itn->fb_tunnel_dev); | 862 | return PTR_RET(itn->fb_tunnel_dev); |
@@ -884,8 +886,6 @@ static void ip_tunnel_destroy(struct ip_tunnel_net *itn, struct list_head *head, | |||
884 | if (!net_eq(dev_net(t->dev), net)) | 886 | if (!net_eq(dev_net(t->dev), net)) |
885 | unregister_netdevice_queue(t->dev, head); | 887 | unregister_netdevice_queue(t->dev, head); |
886 | } | 888 | } |
887 | if (itn->fb_tunnel_dev) | ||
888 | unregister_netdevice_queue(itn->fb_tunnel_dev, head); | ||
889 | } | 889 | } |
890 | 890 | ||
891 | void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops) | 891 | void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops) |
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index d6c856b17fd4..c31e3ad98ef2 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
@@ -61,7 +61,7 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, | |||
61 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); | 61 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); |
62 | 62 | ||
63 | /* Push down and install the IP header. */ | 63 | /* Push down and install the IP header. */ |
64 | __skb_push(skb, sizeof(struct iphdr)); | 64 | skb_push(skb, sizeof(struct iphdr)); |
65 | skb_reset_network_header(skb); | 65 | skb_reset_network_header(skb); |
66 | 66 | ||
67 | iph = ip_hdr(skb); | 67 | iph = ip_hdr(skb); |