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
F87477115: D38714.id117744.diff
Wed, Jul 3, 5:01 PM
Unknown Object (File)
Sat, Jun 29, 4:30 AM
Unknown Object (File)
Thu, Jun 27, 12:40 AM
Unknown Object (File)
Fri, Jun 21, 8:19 AM
Unknown Object (File)
Tue, Jun 11, 7:18 PM
Unknown Object (File)
Mon, Jun 10, 2:57 PM
Unknown Object (File)
Sat, Jun 8, 8:17 PM
Unknown Object (File)
May 12 2024, 9:35 PM
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 Not Applicable
Unit
Tests Not Applicable

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
2170–2171
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.