netdev
[Top] [All Lists]

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

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: [PATCH 2.6.X] SIOCSIFNAME wilcard suppor & name validation
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Wed, 14 Jan 2004 16:13:24 -0800
Cc: jt@xxxxxxxxxx, jt@xxxxxxxxxxxxxxxxxx, jgarzik@xxxxxxxxx, netdev@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
In-reply-to: <20040113162112.509edb71.davem@xxxxxxxxxx>
Organization: Open Source Development Lab
References: <20040112234332.GA1785@xxxxxxxxxxxxxxxxxx> <20040113142204.0b41403b.shemminger@xxxxxxxx> <20040113162112.509edb71.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
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);
        }

<Prev in Thread] Current Thread [Next in Thread>