netdev
[Top] [All Lists]

Re: When are net_device names changed/changeable?

To: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Subject: Re: When are net_device names changed/changeable?
From: Andi Kleen <ak@xxxxxx>
Date: Thu, 12 Oct 2000 03:16:20 +0200
Cc: linux-net <linux-net@xxxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
In-reply-to: <39E419A1.DAE3F651@candelatech.com>; from greearb@candelatech.com on Wed, Oct 11, 2000 at 08:54:21AM +0200
References: <39E419A1.DAE3F651@candelatech.com>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, Oct 11, 2000 at 08:54:21AM +0200, Ben Greear wrote:
> I'm trying to write a hash structure that will hold the devices,
> hashed by both name and index.
> 
> It seems that the devices are first named generically: eth%d,
> and at some later date, are initialized correctly.  This, of course,
> completely screws up any name-based hashing I might have had...
> 
> If names can change at any time, then I'll just quit trying to
> hash on them.  However, if they only change up to some certain
> step, then I'll be able to just initialize the hash list after that.
> 
> Are the device names (for the devices in dev_base) un-changable after
> some point?  What is this point?  (Would 'at-the-first-dev-add' be ok?)

Root can change them anytime using SIOCSIFNAME. I wrote a small program
to rename net devices based on the MAC address, which used it successfully
(so eth0 was always the same adapter, no matter how the modules were loaded)

> 
> If this is un-workable, I can still hash on ifindex I think, it's
> immutable, right?

It is inmutable correct, and easier to hash on anyways.


-Andi

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