Page MenuHomeFreeBSD

add RENAME devctl event for IFNET
ClosedPublic

Authored by rozhuk.im-gmail.com on Jun 21 2021, 11:08 AM.

Details

Summary

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

Result
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

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit 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.
sbin/devd/devd.conf.5
469

Don't forget to touch the .Dd too.

sys/net/if.c
2676

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
rozhuk.im-gmail.com 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 https://reviews.freebsd.org/D30840 for file: sbin/devd/devd.conf.5

This looks good to me now.

This revision was automatically updated to reflect the committed changes.