Page MenuHomeFreeBSD

add RENAME devctl event for IFNET

Authored by on Jun 21 2021, 11:08 AM.



Add devd event on network iface rename.

Test Plan

Apply patch, rebuild and reinstall kernel.

Run in terminal1:
cat /var/run/devd.pipe

In terminal2:
ifconfig lan0 name lan1
ifconfig lan1 name lan0

terminal1 will produce output:
!system=IFNET subsystem=lan0 type=RENAME name=lan1
!system=IFNET subsystem=lan1 type=RENAME name=lan0

*lan0 must me replaced with real network interface name.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

Can you add rename to sbin/devd/devd.conf.5 please?

There's insufficient context in the diff. If you created this revision through the web interface, use "diff -U 9999" to capture more context. OTOH, you won't need to do that if you use the arcanist CLI,

asomers requested changes to this revision.Jun 22 2021, 7:19 PM
asomers added inline comments.

Don't forget to touch the .Dd too.


I think you're sending the notification too early. It looks to me like it would be possible for userspace to see the notification before the interface has its new name.

This revision now requires changes to proceed.Jun 22 2021, 7:19 PM marked 2 inline comments as done.

Add var old_name to keep if_xname.

This revision is now accepted and ready to land.Jun 22 2021, 11:46 PM

This diff based on changes from for file: sbin/devd/devd.conf.5

This looks good to me now.

This revision was automatically updated to reflect the committed changes.