original interface name? (5.*)

Brooks Davis brooks at one-eyed-alien.net
Fri Sep 10 12:34:40 PDT 2004


On Fri, Sep 10, 2004 at 09:30:11PM +0200, Max Laier wrote:
> On Friday 10 September 2004 21:18, Valentin Nechayev wrote:
> > Hi,
> > is there a stable way to determine original interface name (before
> > any renaming) in 5.3? I.e. as driver + sequence number?
> 
> From inside the kernel you can use ifnet.if_dname + ifnet.if_dunit, from the 
> userland I don't know if it's possible to get a look at those fields.
> 
> In any way, I suggest not to do that. ifnet.if_xname is supposed to be *the* 
> name of the interface. There is no such thing as "original name".

Yes, for that matter, the name should not be considered to be a reliable
handle to an interface unless you know it won't change.  This means it's
OK for rc.conf or ifconfig, but not OK for a long running, general
purpose monitoring program.  In 6-CURRENT, and hopefully 5.3, the
correct unique identification of an interface will be its index and the
value of ifi_epoch.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20040910/bbbeb93f/attachment.bin


More information about the freebsd-net mailing list