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)
Thu, May 2, 4:37 AM
Unknown Object (File)
Thu, May 2, 4:37 AM
Unknown Object (File)
Thu, May 2, 4:37 AM
Unknown Object (File)
Tue, Apr 30, 2:27 PM
Unknown Object (File)
Tue, Apr 30, 1:01 PM
Unknown Object (File)
Fri, Apr 26, 1:17 AM
Unknown Object (File)
Thu, Apr 25, 7:10 PM
Unknown Object (File)
Apr 2 2024, 11:51 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

melifaro added inline comments.
sys/net/rtsock.c
318–323

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
318–323

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
318–323

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

glebius added inline comments.
sys/net/rtsock.c
318–323

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.