Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-03-02 Thread Jarek Poplawski
On Thu, Mar 01, 2007 at 11:27:34AM -0800, Jean Tourrilhes wrote: > On Thu, Mar 01, 2007 at 08:42:09AM +0100, Jarek Poplawski wrote: > > On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: > > > > > + > > > > > + if ((size <= 0) || (i >= num_envp)) > > > > > > > > Btw.: > > > > 1.

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-03-02 Thread Jarek Poplawski
On Thu, Mar 01, 2007 at 11:27:34AM -0800, Jean Tourrilhes wrote: On Thu, Mar 01, 2007 at 08:42:09AM +0100, Jarek Poplawski wrote: On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: + + if ((size = 0) || (i = num_envp)) Btw.: 1. if size == 10 and snprintf

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-03-01 Thread Jean Tourrilhes
On Thu, Mar 01, 2007 at 08:42:09AM +0100, Jarek Poplawski wrote: > On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: > > > > + > > > > + if ((size <= 0) || (i >= num_envp)) > > > > > > Btw.: > > > 1. if size == 10 and snprintf returns 9 (without NULL) > > >then n == 10

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-03-01 Thread Jean Tourrilhes
On Thu, Mar 01, 2007 at 08:42:09AM +0100, Jarek Poplawski wrote: On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: + + if ((size = 0) || (i = num_envp)) Btw.: 1. if size == 10 and snprintf returns 9 (without NULL) then n == 10 (with NULL), so isn't it

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: > On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: > > On 28-02-2007 02:27, Jean Tourrilhes wrote: > > > Hi all, > > ... > > > Patch for 2.6.20 is attached. The patch was tested on a system > > > running the

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 16:51 -0800, Jean Tourrilhes wrote: > I would prefer to fix the comment when this change actually > happens. I prefer comments to refer to the current reality, rather > than past/future situation. Uh, no. device_rename is perfectly fine, even other people may use it

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Thu, Mar 01, 2007 at 01:37:46AM +0100, Johannes Berg wrote: > On Wed, 2007-02-28 at 16:26 -0800, Jean Tourrilhes wrote: > > > + /* This function is only used for network interface. > > +* Some hotplug package track interfaces by their name and > > +* therefore want to know when the

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 16:26 -0800, Jean Tourrilhes wrote: > + /* This function is only used for network interface. > + * Some hotplug package track interfaces by their name and > + * therefore want to know when the name is changed by the user. */ Right now, that's true, but

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 07:36:17AM -0800, Greg KH wrote: > On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: > > diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c > > --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 > > +++

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 10:51 -0800, Jean Tourrilhes wrote: > That's why I always specify the kernel version. I'll look into > that, I'm sure it's not the end of the world ;-) Sure, just wanted to point it out. > In which sense ? Wireless interface are regular netdevices. Yeah but in

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 10:16:05AM +0100, Johannes Berg wrote: > Hi, > > > Patch for 2.6.20 is attached. > > ... and in the meantime netdevices aren't class_device any more :) IOW, > your patch isn't going to work any more. That's why I always specify the kernel version. I'll look

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: > On 28-02-2007 02:27, Jean Tourrilhes wrote: > > Hi all, > ... > > Patch for 2.6.20 is attached. The patch was tested on a system > > running the hotplug scripts, and on another system running udev. > > > > Have fun...

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 07:36:17AM -0800, Greg KH wrote: > On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: > > diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c > > --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 > > +++

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Greg KH
On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: > diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c > --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 > +++ linux/drivers/base/class.c2007-02-27 15:52:37.0 -0800 > @@ -841,6

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: > On 28-02-2007 02:27, Jean Tourrilhes wrote: ... > > + /* This function is only used for network interface. > > +* Some hotplug package track interfaces by their name and > > +* therefore want to know when the name is

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On 28-02-2007 02:27, Jean Tourrilhes wrote: > Hi all, ... > Patch for 2.6.20 is attached. The patch was tested on a system > running the hotplug scripts, and on another system running udev. > > Have fun... > > Jean > > Signed-off-by: Jean Tourrilhes <[EMAIL PROTECTED]> >

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
Hi, > Patch for 2.6.20 is attached. ... and in the meantime netdevices aren't class_device any more :) IOW, your patch isn't going to work any more. Also, I think wireless could benefit from this as well. > The kobject framework is well designed, so adding these > features is

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
Hi, Patch for 2.6.20 is attached. ... and in the meantime netdevices aren't class_device any more :) IOW, your patch isn't going to work any more. Also, I think wireless could benefit from this as well. The kobject framework is well designed, so adding these features is trivial

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On 28-02-2007 02:27, Jean Tourrilhes wrote: Hi all, ... Patch for 2.6.20 is attached. The patch was tested on a system running the hotplug scripts, and on another system running udev. Have fun... Jean Signed-off-by: Jean Tourrilhes [EMAIL PROTECTED]

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: On 28-02-2007 02:27, Jean Tourrilhes wrote: ... + /* This function is only used for network interface. +* Some hotplug package track interfaces by their name and +* therefore want to know when the name is changed by

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Greg KH
On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 +++ linux/drivers/base/class.c2007-02-27 15:52:37.0 -0800 @@ -841,6

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 07:36:17AM -0800, Greg KH wrote: On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 +++

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: On 28-02-2007 02:27, Jean Tourrilhes wrote: Hi all, ... Patch for 2.6.20 is attached. The patch was tested on a system running the hotplug scripts, and on another system running udev. Have fun...

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 10:16:05AM +0100, Johannes Berg wrote: Hi, Patch for 2.6.20 is attached. ... and in the meantime netdevices aren't class_device any more :) IOW, your patch isn't going to work any more. That's why I always specify the kernel version. I'll look into

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 10:51 -0800, Jean Tourrilhes wrote: That's why I always specify the kernel version. I'll look into that, I'm sure it's not the end of the world ;-) Sure, just wanted to point it out. In which sense ? Wireless interface are regular netdevices. Yeah but in

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Wed, Feb 28, 2007 at 07:36:17AM -0800, Greg KH wrote: On Tue, Feb 27, 2007 at 05:27:41PM -0800, Jean Tourrilhes wrote: diff -u -p linux/drivers/base/class.j1.c linux/drivers/base/class.c --- linux/drivers/base/class.j1.c 2007-02-26 18:38:10.0 -0800 +++

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 16:26 -0800, Jean Tourrilhes wrote: + /* This function is only used for network interface. + * Some hotplug package track interfaces by their name and + * therefore want to know when the name is changed by the user. */ Right now, that's true, but wireless

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jean Tourrilhes
On Thu, Mar 01, 2007 at 01:37:46AM +0100, Johannes Berg wrote: On Wed, 2007-02-28 at 16:26 -0800, Jean Tourrilhes wrote: + /* This function is only used for network interface. +* Some hotplug package track interfaces by their name and +* therefore want to know when the name is

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Johannes Berg
On Wed, 2007-02-28 at 16:51 -0800, Jean Tourrilhes wrote: I would prefer to fix the comment when this change actually happens. I prefer comments to refer to the current reality, rather than past/future situation. Uh, no. device_rename is perfectly fine, even other people may use it in

Re: [PATCH 2.6.20] kobject net ifindex + rename

2007-02-28 Thread Jarek Poplawski
On Wed, Feb 28, 2007 at 10:45:41AM -0800, Jean Tourrilhes wrote: On Wed, Feb 28, 2007 at 10:34:37AM +0100, Jarek Poplawski wrote: On 28-02-2007 02:27, Jean Tourrilhes wrote: Hi all, ... Patch for 2.6.20 is attached. The patch was tested on a system running the hotplug scripts,

[PATCH 2.6.20] kobject net ifindex + rename

2007-02-27 Thread Jean Tourrilhes
Hi all, Various hotplug packages have had trouble dealing with network interface being renamed. I've decided to tackle this issue from two angles : o export ifindex to those apps, as ifindex is persistent. o expose interface renaming as a hotplug

[PATCH 2.6.20] kobject net ifindex + rename

2007-02-27 Thread Jean Tourrilhes
Hi all, Various hotplug packages have had trouble dealing with network interface being renamed. I've decided to tackle this issue from two angles : o export ifindex to those apps, as ifindex is persistent. o expose interface renaming as a hotplug