netdev
[Top] [All Lists]

Re: [BK PATCH 2.6] fix sysctl breakage during network device renaming, f

To: Dan Aloni <da-x@xxxxxxx>
Subject: Re: [BK PATCH 2.6] fix sysctl breakage during network device renaming, for ipv4
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Wed, 27 Aug 2003 23:28:47 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20030826153812.GA2216@xxxxxxxxxxxxxxx>
References: <20030826153812.GA2216@xxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Tue, 26 Aug 2003 18:38:12 +0300
Dan Aloni <da-x@xxxxxxx> wrote:

>   Sysctl assumes its ctl_table.procname field is const, but the 
>   networking points ctl_table.procname to dev->name. When renaming 
>   a network device using SIOCSIFNAME, dev->name is modified and 
>   sysctl's assumption breaks, causing this behaviour, at least:
>   
>     1. sysctl wouldn't be able to remove the proc entry when the 
>        device requests to be unregistered, because it would be 
>        using the new name instead of the old one.
>     2. proc entries for devices remain with the old name after 
>        rename.
>     
>   This change includes allocating the current device name to a
>   new copy upon registering with sysctl, plus re-registering with 
>   sysctl when the device is renamed.

Conceptually this change is OK.  But please don't put generic
things like a strdup() implementation statically into
net/ipv4/devinet.c, it does not belong there.

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