Skip to content

Commit

Permalink
- add more linux socket options (sorted by value)
Browse files Browse the repository at this point in the history
 - map those IPv4 / IPv6 socket options which exist in FreeBSD
   + most of them visually verified to have the same type/layout of arguments
   + not tested with linux programs to behave as intended
 - be more human readable for known options which are not handled
 - be more verbose for unhandled socket message flags we know about
 - print the jail ID in linux_msg if run in a jail
 - add possibility to print debug message about known missing parts only once
 - add multiple levels of sysctl linux.debug:
   1: print debug messages, tell about unimplemented stuff (only once)
   2: like 1, but also print messages about implemented but not tested
      stuff (only once)
   3+: like 2, but no rate limiting of messages
 - increase default linux debug level from 1 to 3

We are a lot more verbose in as we need to be (e.g. some of the IP socket
options which are the same, and share the same memory layout, and are
believed to work). The reason is that we have no good testsuite to test those
linux-bits. The LTP or other test suites like the python one, are not fully
up to the task we need. As such the excessive messages about emulated but not
tested socket options.

IMO any MFC (possible, but most probably not by me) should set the default
debug level to 1.

Discussed with:	trasz
  • Loading branch information
netchild committed Nov 8, 2020
1 parent c8346b6 commit b4ef999
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 31 deletions.
7 changes: 6 additions & 1 deletion share/man/man4/linux.4
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ tunables:
.It Va compat.linux.debug
Enable debugging messages.
Set to 0 to silence them.
Defaults to 1.
Defaults to 3.
A setting of 1 prints debug messages, tells about unimplemented stuff (only
once).
Set to 2 is like 1, but also prints messages about implemented but not tested
stuff (only once).
Setting it to 3 or higher is like 2, but no rate limiting of messages.
.It Va compat.linux.default_openfiles
Default soft openfiles resource limit for Linux applications.
Set to -1 to disable the limit.
Expand Down
2 changes: 1 addition & 1 deletion sys/compat/linux/linux_mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static unsigned linux_osd_jail_slot;
SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"Linux mode");

int linux_debug = 1;
int linux_debug = 3;
SYSCTL_INT(_compat_linux, OID_AUTO, debug, CTLFLAG_RWTUN,
&linux_debug, 0, "Log warnings from linux(4); or 0 to disable");

Expand Down
Loading

0 comments on commit b4ef999

Please sign in to comment.