Page MenuHomeFreeBSD

netlink: provide original ifname in the interface dump.
Needs ReviewPublic

Authored by melifaro on Apr 18 2023, 2:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 8:21 PM
Unknown Object (File)
Mar 18 2024, 1:50 PM
Unknown Object (File)
Feb 13 2024, 8:00 AM
Unknown Object (File)
Feb 12 2024, 8:37 AM
Unknown Object (File)
Dec 22 2023, 10:36 PM
Unknown Object (File)
Dec 10 2023, 1:32 PM
Unknown Object (File)
Nov 30 2023, 4:58 PM
Unknown Object (File)
Aug 15 2023, 8:44 PM

Details

Reviewers
None
Group Reviewers
network
Summary

This change provide an alternative to the ifmib "IFDATA_DRIVERNAME" API.

Event Timeline

kp added inline comments.
sys/netlink/route/iface.c
178

I think that's wrong. Or rather, it only works for most interfaces, not all.

With if_epair you'll end up with 'epair0' for both epair0a and epair0b.
And I think that on if_ovpn interfaces you'll end up with 'openvpn0', even if the interface was originally 'ovpnc0'.

sys/netlink/route/iface.c
178

Ack, that's a good one. Do you think something based on the cloner-specific callback w/ fallback to this composition would do the trick?

sys/netlink/route/iface.c
178

I'm not sure I see how that'd work.

My thinking was that we're just going to have to add a char orig_ifname[IFNAMSIZ] to struct ifnet. It can probably be populated from if_attach() (perhaps with an 'if not already set' check, to cope with if_vmove()).

There's all sorts of fun around interface names and locking and error handling, but if all we do is store the original name and return it to userspace those issues don't matter.

sys/netlink/route/iface.c
178

I agree that it's the simplest solution, but I have somewhat mixed feelings around that.
If that's a rarely used feature, I'd rather not make struct ifnet even bigger, but try to calculate the original name instead.

Anyway, I guess the composition function needs to be in the if.c and the arguments should permit different implementations. I'll come up with a separate review then, so we can have more targetted discussion :-)