aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/sit.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-02-23 23:19:20 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-23 23:19:20 -0500
commit34cc7ba6398203aab4056917fa1e2aa5988487aa (patch)
tree40fc152c1d9722ca70154bd6d989694fff526280 /net/ipv6/sit.c
parent55b01e8681cba392ccda4ff6184054d38968115d (diff)
[IP_TUNNEL]: Don't limit the number of tunnels with generic name explicitly.
Use the added dev_alloc_name() call to create tunnel device name, rather than iterate in a hand-made loop with an artificial limit. Thanks Patrick for noticing this. [ The way this works is, when the device is actually registered, the generic code noticed the '%' in the name and invokes dev_alloc_name() to fully resolve the name. -DaveM ] Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r--net/ipv6/sit.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index e77239d02bf5..dde7801abeff 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -164,16 +164,8 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
164 164
165 if (parms->name[0]) 165 if (parms->name[0])
166 strlcpy(name, parms->name, IFNAMSIZ); 166 strlcpy(name, parms->name, IFNAMSIZ);
167 else { 167 else
168 int i; 168 sprintf(name, "sit%%d");
169 for (i=1; i<100; i++) {
170 sprintf(name, "sit%d", i);
171 if (__dev_get_by_name(&init_net, name) == NULL)
172 break;
173 }
174 if (i==100)
175 goto failed;
176 }
177 169
178 dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); 170 dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup);
179 if (dev == NULL) 171 if (dev == NULL)