]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - net/ipv4/ipip.c
[NET]: Make the device list and device lookups per namespace.
[mirror_ubuntu-zesty-kernel.git] / net / ipv4 / ipip.c
index ebd2f2d532f66bd1e57d173cde001026da1527dd..652bd86e33a38cf1ea689e127d8fb9138e1dcdc4 100644 (file)
@@ -225,7 +225,7 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
                int i;
                for (i=1; i<100; i++) {
                        sprintf(name, "tunl%d", i);
-                       if (__dev_get_by_name(name) == NULL)
+                       if (__dev_get_by_name(&init_net, name) == NULL)
                                break;
                }
                if (i==100)
@@ -595,7 +595,8 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
         */
        max_headroom = (LL_RESERVED_SPACE(tdev)+sizeof(struct iphdr));
 
-       if (skb_headroom(skb) < max_headroom || skb_cloned(skb) || skb_shared(skb)) {
+       if (skb_headroom(skb) < max_headroom || skb_shared(skb) ||
+           (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {
                struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
                if (!new_skb) {
                        ip_rt_put(rt);
@@ -821,7 +822,7 @@ static int ipip_tunnel_init(struct net_device *dev)
        }
 
        if (!tdev && tunnel->parms.link)
-               tdev = __dev_get_by_index(tunnel->parms.link);
+               tdev = __dev_get_by_index(&init_net, tunnel->parms.link);
 
        if (tdev) {
                dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr);