提交 9cb17124 编写于 作者: D David S. Miller

Merge branch 'ip_tunnel'

ip_tunnel bug fixes from Steffen Klassert.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -642,13 +642,13 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -642,13 +642,13 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) max_headroom = LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr)
+ rt->dst.header_len; + rt->dst.header_len;
if (max_headroom > dev->needed_headroom) { if (max_headroom > dev->needed_headroom)
dev->needed_headroom = max_headroom; dev->needed_headroom = max_headroom;
if (skb_cow_head(skb, dev->needed_headroom)) {
dev->stats.tx_dropped++; if (skb_cow_head(skb, dev->needed_headroom)) {
dev_kfree_skb(skb); dev->stats.tx_dropped++;
return; dev_kfree_skb(skb);
} return;
} }
err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, 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,8 +853,10 @@ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
/* FB netdevice is special: we have one, and only one per netns. /* FB netdevice is special: we have one, and only one per netns.
* Allowing to move it to another netns is clearly unsafe. * Allowing to move it to another netns is clearly unsafe.
*/ */
if (!IS_ERR(itn->fb_tunnel_dev)) if (!IS_ERR(itn->fb_tunnel_dev)) {
itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL; itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev));
}
rtnl_unlock(); rtnl_unlock();
return PTR_RET(itn->fb_tunnel_dev); 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,8 +886,6 @@ static void ip_tunnel_destroy(struct ip_tunnel_net *itn, struct list_head *head,
if (!net_eq(dev_net(t->dev), net)) if (!net_eq(dev_net(t->dev), net))
unregister_netdevice_queue(t->dev, head); unregister_netdevice_queue(t->dev, head);
} }
if (itn->fb_tunnel_dev)
unregister_netdevice_queue(itn->fb_tunnel_dev, head);
} }
void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops) void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops)
......
...@@ -61,7 +61,7 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, ...@@ -61,7 +61,7 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
memset(IPCB(skb), 0, sizeof(*IPCB(skb))); memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
/* Push down and install the IP header. */ /* Push down and install the IP header. */
__skb_push(skb, sizeof(struct iphdr)); skb_push(skb, sizeof(struct iphdr));
skb_reset_network_header(skb); skb_reset_network_header(skb);
iph = ip_hdr(skb); iph = ip_hdr(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册