Getting /dev entry by interface name

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Apr 7 08:17:31 UTC 2018


--------
In message <20180407025807.GA18883 at kloomba>, Roman Bogorodskiy writes:

>1. Create tap(4) like that:
>
># ifconfig tap create
>tap2
>#
>
>2. Rename it
>
># ifconfig tap2 name testif
>testif
>
>Now I can do 'ifconfig testif' and there'll be no signs that it was
>named 'tap2' previously, however, in /dev it's still /dev/tap2.

I would argue that is an error.

The /dev entry should also be renamed, or maybe better, a symlink
with the new name should be created, pointing to the /dev/tap%d
entry.

However, I dont know if that is actually possible, is the device
driver even even told about the new interface name ?

There is also a name-space validation issue to think about:

	ifconfig tap2 name ../etc

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-hackers mailing list