Page MenuHomeFreeBSD

add RENAME devctl event for IFNET
ClosedPublic

Authored by rozhuk.im-gmail.com on Jun 21 2021, 11:08 AM.
Tags
None
Referenced Files
F80140568: D30839.diff
Thu, Mar 28, 11:53 AM
Unknown Object (File)
Thu, Feb 29, 7:36 AM
Unknown Object (File)
Wed, Feb 28, 7:42 PM
Unknown Object (File)
Feb 13 2024, 11:17 PM
Unknown Object (File)
Feb 13 2024, 11:17 PM
Unknown Object (File)
Feb 13 2024, 11:11 PM
Unknown Object (File)
Feb 13 2024, 11:11 PM
Unknown Object (File)
Jan 12 2024, 9:32 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
rG FreeBSD src repository
Lint
Lint Not Applicable
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
470

Don't forget to touch the .Dd too.

sys/net/if.c
2677

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.