Page MenuHomeFreeBSD

rtsock: do not use raw socket code
ClosedPublic

Authored by glebius on Aug 10 2022, 7:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 4:28 PM
Unknown Object (File)
Thu, Nov 14, 1:34 PM
Unknown Object (File)
Sun, Nov 10, 5:04 PM
Unknown Object (File)
Thu, Nov 7, 10:03 PM
Unknown Object (File)
Mon, Oct 28, 4:51 AM
Unknown Object (File)
Oct 8 2024, 8:15 AM
Unknown Object (File)
Oct 1 2024, 7:44 AM
Unknown Object (File)
Sep 30 2024, 1:39 PM
Subscribers

Details

Summary

This makes routing socket implementation self contained and removes one
of the last dependencies on the raw socket code and pr_output method.

There are very subtle API visible changes:

  • now routing socket would return EOPNOTSUPP instead of EINVAL on syscalls that are not supposed to be called on a routing socket.
  • routing socket buffer sizes are now controlled by net.rtsock sysctls instead of net.raw. The latter were not documented anywhere, and even Internet search doesn't find any references or discussions related to these sysctls.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningsys/net/rtsock.c:965SPELL1Possible Spelling Mistake
Unit
No Test Coverage
Build Status
Buildable 46839
Build 43728: arc lint + arc unit

Event Timeline

melifaro added inline comments.
sys/net/rtsock.c
295–300

Nit: worth having a separate function to simplify code here / in the last condition.

This revision is now accepted and ready to land.Aug 11 2022, 8:13 AM
sys/net/rtsock.c
295–300

I'd rather remove the optimization with not doing m_copym() for the last mbuf. This isn't high performance path and IMHO the added complexity isn't justified. But in a separate change.

sys/net/rtsock.c
295–300

It's often just one active (routing daemon) rtsock socket in the system receiving the events.

glebius added inline comments.
sys/net/rtsock.c
295–300

Will do!

This revision was landed with ongoing or failed builds.Aug 11 2022, 4:20 PM
This revision was automatically updated to reflect the committed changes.
glebius marked an inline comment as done.