Page MenuHomeFreeBSD

tcp: allow SOL_SOCKET level socket options via sysctl interface
ClosedPublic

Authored by tuexen on Dec 9 2023, 9:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 2:36 PM
Unknown Object (File)
Sat, Nov 2, 2:07 PM
Unknown Object (File)
Sep 30 2024, 4:16 PM
Unknown Object (File)
Sep 24 2024, 9:18 AM
Unknown Object (File)
Sep 13 2024, 8:15 AM
Unknown Object (File)
Sep 11 2024, 10:46 PM
Unknown Object (File)
Aug 22 2024, 5:26 PM
Unknown Object (File)
Aug 19 2024, 9:24 AM
Subscribers

Details

Summary

When setting a SOL_SOCKET-level socket option, the TCP handler refers to the IP handler, which only handles SO_SETFIB and SO_MAX_PACING_RATE. So call sosetopt(), which handles all SOL_SOCKET-level options.
We could call sosetopt() always, but that would do a INP_WUNLOCK() followed up by a INP_WLOCK() in cases where the level is not SOL_SOCKET.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tuexen requested review of this revision.Dec 9 2023, 9:38 AM

Since this is from tcpsso - just curious if it wouldn't be possible to call setsockopt from within that utility after getting the socket from the inpcb id?

This revision is now accepted and ready to land.Dec 9 2023, 10:25 AM

Since this is from tcpsso - just curious if it wouldn't be possible to call setsockopt from within that utility after getting the socket from the inpcb id?

tcpsso does not get the socket. It is the kernel in sysctl_setsockopt(), which can access the socket. It already does so to add a reference to it.

So, no way to change the e.g. SO_SNDBUF on existing kernels then.. :(

So, no way to change the e.g. SO_SNDBUF on existing kernels then.. :(

No, but you know which patch to apply...