aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 63f691719353..906cb1ada4c3 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -259,16 +259,8 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
259 259
260 if (parms->name[0]) 260 if (parms->name[0])
261 strlcpy(name, parms->name, IFNAMSIZ); 261 strlcpy(name, parms->name, IFNAMSIZ);
262 else { 262 else
263 int i; 263 sprintf(name, "gre%%d");
264 for (i=1; i<100; i++) {
265 sprintf(name, "gre%d", i);
266 if (__dev_get_by_name(&init_net, name) == NULL)
267 break;
268 }
269 if (i==100)
270 goto failed;
271 }
272 264
273 dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); 265 dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
274 if (!dev) 266 if (!dev)