Page MenuHomeFreeBSD

Reduce duplication between MD parts of the Linuxulator
ClosedPublic

Authored by dchagin on May 2 2019, 11:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 29, 10:29 AM
Unknown Object (File)
Feb 19 2024, 9:12 AM
Unknown Object (File)
Dec 22 2023, 9:15 PM
Unknown Object (File)
Dec 13 2023, 4:13 PM
Unknown Object (File)
Dec 1 2023, 2:11 AM
Unknown Object (File)
Oct 23 2023, 4:03 AM
Unknown Object (File)
Sep 23 2023, 3:04 PM
Unknown Object (File)
Sep 6 2023, 11:06 AM
Subscribers

Details

Summary

In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use MI types for struct members.

And continue to move into the linux_common module a code that is
intended for both Linuxulator modules (both instruction set - 32 & 64 bit)
or for external modules like linsysfs or linprocfs.

To avoid header pollution introduce new sys/compat/linux_common.h header.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 24057

Event Timeline

Overall looks good to me, a few comments inline. Minor comment - ideally we'd commit the verbatim code movement first in one commit followed by the new functionality (e.g. is_lo).

sys/compat/linux/linux.c
230

make is_eth and is_lo bool?

238

This line seems a bit awkward and style(9) prefers not using ! (in !strncmp) I think? What about just is_lo = len == 2 && strcmp(lxname, "lo") == 0;

272–280

Existing code but it seems we'd be better without any assumption Linux and FreeBSD flags are in the same bit, maybe something for a future change?

dchagin edited the summary of this revision. (Show Details)

Split the patch into two parts, modifying ifname_linux_to_bsd() will be next

dchagin added inline comments.
sys/compat/linux/linux.c
230

next review

238

next review

272–280

yes, I thought about it, I will fix this next

This revision is now accepted and ready to land.May 2 2019, 3:23 PM
This revision was automatically updated to reflect the committed changes.
dchagin marked an inline comment as done.