what is the story on if_index allocation ?

Luigi Rizzo rizzo at icir.org
Tue Apr 20 23:38:19 PDT 2004


On Wed, Apr 21, 2004 at 09:25:59AM +0300, Petri Helenius wrote:
> Luigi Rizzo wrote:
> 
> >Can someone explain what is the goal ? Reuse a number if an
> >interface has the same name of a previously existing one and
> >the index is free ? And does it make sense, anyways, or
> >we could just simplify that code and just reuse the first
> >available entry in ifindex_table[] ?
> >  
> >
> The optimal course of action (from management software point of view) is 
> to retain as static ifName to ifIndex mapping. If the index changes for 

I do not think the current code supports this, as any free
index at the top of the array is reused. So if you had 'vlan12' there
and it went away, the next interface that comes in will grab that
index and vlan12 will get a new one. On top of this you can rename
interfaces without changing the index, you can change MAC and IP
addresses, in the already mentioned case of a tunnel server
there is basically no relation between successive creations on
the same interface.

My feeling is that there is not even a sensible way to specify
how one would like to retain the mapping of indexes, let alone
the fact that the specification changes depending on whom you
ask. When this happens, it is a good hint to move the issue
outside the kernel.

cheers
luigi


More information about the freebsd-net mailing list