Page MenuHomeFreeBSD

linux(4): Consolidate a FreeBSD interface names translation code
ClosedPublic

Authored by dchagin on Feb 21 2023, 10:29 PM.
Tags
None
Referenced Files
F102402385: D38714.id.diff
Mon, Nov 11, 6:56 PM
F102401650: D38714.id.diff
Mon, Nov 11, 6:40 PM
Unknown Object (File)
Oct 5 2024, 3:30 AM
Unknown Object (File)
Sep 24 2024, 7:22 PM
Unknown Object (File)
Sep 24 2024, 7:22 PM
Unknown Object (File)
Sep 24 2024, 7:21 PM
Unknown Object (File)
Sep 24 2024, 5:15 PM
Unknown Object (File)
Sep 24 2024, 3:45 AM
Subscribers

Details

Summary

We have some amount of interface names translation functions which are
differs by bugs implementation. Consolidates it in a one place.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49955
Build 46847: arc lint + arc unit

Event Timeline

@jhibbits, I also reverted 52435989, as linprocfs code also needed to update

@jhibbits, I also reverted 52435989, as linprocfs code also needed to update

I just reverted that, so you can simplify your diff.

Initialize ret to 0 for case when nothing is found

Otimized, ethno calculated in callers to avoid one for over ifnets

sys/compat/linux/linux.c
249

Nit: ‘const char *bsdname’. It would help to understand whar ‘len’ refers to

ifnet_byindex, ifuint instead of handmade,
also use net ecoch in modified code, others later

fix ifconf, btw, ifconf is no more used by glibc, replaced by netlink...

ugh, fie net epoch in linprocfs donetroute, tested

melifaro added inline comments.
sys/compat/linux/linux.c
308

There can be more that one loopback interface, so I guess we need to rename only the first one (e.g. "lo0") and keep the rest intact.

sys/compat/linux/linux_ioctl.c
2169–2170
This revision is now accepted and ready to land.Feb 22 2023, 12:52 PM

fix lo -> lo0, loX -> loX translation

This revision now requires review to proceed.Feb 22 2023, 1:54 PM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 23 2023, 8:01 AM
This revision was automatically updated to reflect the committed changes.