Re: [PATCH 2.6.X] SIOCSIFNAME wilcard suppor & name validation

Stephen Hemminger
2004-01-15T00:14:34Z

Bug: dev_alloc_name returns the number of the slot used, so comparison needs
to be < 0.

diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c Wed Jan 14 16:09:02 2004
+++ b/net/core/dev.c Wed Jan 14 16:09:02 2004
@@ -718,7 +718,7 @@

if (strchr(newname, '%')) {
int err = dev_alloc_name(dev, newname);
- if (err)
+ if (err < 0)
return err;
strcpy(newname, dev->name);
}