Page MenuHomeFreeBSD

divert: Define semantics for SO_REUSEPORT_LB on divert sockets
AcceptedPublic

Authored by markj on Tue, Apr 21, 7:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 29, 12:22 PM
Unknown Object (File)
Tue, Apr 28, 12:35 PM
Unknown Object (File)
Tue, Apr 28, 11:10 AM
Unknown Object (File)
Mon, Apr 27, 8:37 PM
Unknown Object (File)
Mon, Apr 27, 10:43 AM
Unknown Object (File)
Mon, Apr 27, 9:34 AM
Unknown Object (File)
Mon, Apr 27, 5:23 AM
Unknown Object (File)
Mon, Apr 27, 2:17 AM

Details

Reviewers
glebius
kp
Group Reviewers
network
Summary

Allow SO_REUSEPORT_LB to be set on divert sockets. If set, then bind()
will add the socket to a "load-balancing group". When a divert-to rule
matches a port with an associated group, the corresponding state ID is
used to select a specific socket from the group. Packets without an
associated state are simply forwarded to the first socket in the group.
For now I only pass a state ID from pf, as I couldn't see a useful
identifier on the ipfw side.

This implementation is simple but has some caveats, the main one being
that if sockets are added to the group while flows are being processed,
the size of the group will change and this changes the mapping of state
IDs to sockets. So, to get a consistent mapping, the divert socket
application must bind all of its sockets before any traffic is processed
by pf.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72426
Build 69309: arc lint + arc unit

Event Timeline

markj requested review of this revision.Tue, Apr 21, 7:36 PM

P.S. Touch to raw_ip.c reminds me of my long desire to move those pointers to some more appropriate place at least.

This revision is now accepted and ready to land.Tue, Apr 21, 8:01 PM

The pf change looks fine to me.