netdev
[Top] [All Lists]

Re: [PATCH 2.6 NET] Device name changing via rtnetlink

To: Thomas Graf <tgraf@xxxxxxx>, netdev@xxxxxxxxxxx
Subject: Re: [PATCH 2.6 NET] Device name changing via rtnetlink
From: Jean Tourrilhes <jt@xxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Sep 2004 12:50:03 -0700
Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA.
E-mail: jt@xxxxxxxxxx
Organisation: HP Labs Palo Alto
Reply-to: jt@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
Thomas Graf wrote :
> 
> Allows changing of device name via rtnetlink. Last bit needed to do full
> link configuration via rtnetlink.
> 
> Signed-off-by: Thomas Graf <tgraf@xxxxxxx>

        This does not work, because you don't return the new name to
user space. If the new name is a pattern, such as "eth%d" or "wlan%d",
you absolutely need to return the new instanciated device name to user
space so that userspace doesn't loose track of the device.

        Please look at this snipset from dev.c :

-----------------------------------------------------------------
                /*
                 *      These ioctl calls:
                 *      - require superuser power.
                 *      - require strict serialization.
                 *      - return a value
                 */
                case SIOCGMIIPHY:
                case SIOCGMIIREG:
                case SIOCSIFNAME:
                        if (!capable(CAP_NET_ADMIN))
                                return -EPERM;
                        dev_load(ifr.ifr_name);
                        rtnl_lock();
                        ret = dev_ifsioc(&ifr, cmd);
                        rtnl_unlock();
                        if (!ret) {
                                if (colon)
                                        *colon = ':';
                                if (copy_to_user(arg, &ifr,
                                                 sizeof(struct ifreq)))
                                        ret = -EFAULT;
                        }
                        return ret;
-----------------------------------------------------------------

        I'm all for converting stuff to RtNetlink, but please don't
criple the functionality...

        Have fun...

        Jean


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