]> err.no Git - linux-2.6/blobdiff - net/ipv6/sit.c
[ICMP]: Store sock rather than socket for ICMP flow control.
[linux-2.6] / net / ipv6 / sit.c
index dde7801abeffb83240ac4460c773369843eaa384..1656c003b98958df7afbeaec66a3c7654d4d64ee 100644 (file)
@@ -171,6 +171,11 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
        if (dev == NULL)
                return NULL;
 
+       if (strchr(name, '%')) {
+               if (dev_alloc_name(dev, name) < 0)
+                       goto failed_free;
+       }
+
        nt = netdev_priv(dev);
        dev->init = ipip6_tunnel_init;
        nt->parms = *parms;
@@ -178,16 +183,16 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
        if (parms->i_flags & SIT_ISATAP)
                dev->priv_flags |= IFF_ISATAP;
 
-       if (register_netdevice(dev) < 0) {
-               free_netdev(dev);
-               goto failed;
-       }
+       if (register_netdevice(dev) < 0)
+               goto failed_free;
 
        dev_hold(dev);
 
        ipip6_tunnel_link(nt);
        return nt;
 
+failed_free:
+       free_netdev(dev);
 failed:
        return NULL;
 }