jamal wrote:

If a device goes down, and comes back up with the same name
but a different ifindex, we should still match it with existing
rules based upon name.


The ifindex will change if you unload a module; If you try hard enough you will hit a point where things will wrap
around; you just have to consume the 2^31 ifindices ;->

The man pages mention that ifindex is transient, so no one should
expect it to be otherwise.  I've had good luck saving the name in
the structures that need access to the net-device, but also saving
a pointer to the netdevice for fast lookup.  I listen for messages
indicating that a driver wants to unload and then null out the
pointer to the netdevice at that time.  I do a lazy lookup of the
device if it is ever null, so if the device is removed and comes back,
then the logic repairs itself.

This kind of logic also removes the dev_get_by_idx call in the fast path.

Name is not totaly sane either:
I think one of the fscked s/ware i have seen is pppd that tries
to recycle names immediately with the same name but different ifindex.
It should probably use ppp<ifindex> for name.

That would play merry hell with user-space applications that need to know
what the name of the ppp interface is that they just created
programatically.  There are options to give to pppd to specify the 'X'
in the pppX name, by the way.

In theory, one should be able from user space to really configure the
ifindex; we dont allow for it even for devices that are virtual.

Might work at creation time, but you can't be certain that someone else
hasn't already used the index, at least not easily, so I don't see it gaining
you very much.

--
Ben Greear <[EMAIL PROTECTED]>
Candela Technologies Inc  http://www.candelatech.com

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to