diff options
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index cd940647bd12..2a124e9a1b2d 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -229,18 +229,11 @@ static struct ip6_tnl *ip6_tnl_create(struct ip6_tnl_parm *p) | |||
229 | char name[IFNAMSIZ]; | 229 | char name[IFNAMSIZ]; |
230 | int err; | 230 | int err; |
231 | 231 | ||
232 | if (p->name[0]) { | 232 | if (p->name[0]) |
233 | strlcpy(name, p->name, IFNAMSIZ); | 233 | strlcpy(name, p->name, IFNAMSIZ); |
234 | } else { | 234 | else |
235 | int i; | 235 | sprintf(name, "ip6tnl%%d"); |
236 | for (i = 1; i < IP6_TNL_MAX; i++) { | 236 | |
237 | sprintf(name, "ip6tnl%d", i); | ||
238 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
239 | break; | ||
240 | } | ||
241 | if (i == IP6_TNL_MAX) | ||
242 | goto failed; | ||
243 | } | ||
244 | dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup); | 237 | dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup); |
245 | if (dev == NULL) | 238 | if (dev == NULL) |
246 | goto failed; | 239 | goto failed; |