]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
inpcb: Allow SO_REUSEPORT_LB to be used in jails
authorMark Johnston <markj@FreeBSD.org>
Wed, 2 Nov 2022 17:08:07 +0000 (13:08 -0400)
committerMark Johnston <markj@FreeBSD.org>
Mon, 22 Jan 2024 18:45:03 +0000 (13:45 -0500)
commit535984471641c9435854ed23a80e49a8bf0e53b0
tree9022f769c14898ab28b8225382fc2fdd6ea327ba
parent0ea32f0e83769ca1c6ebc40fb0a3a0e64a24e7a0
inpcb: Allow SO_REUSEPORT_LB to be used in jails

Currently SO_REUSEPORT_LB silently does nothing when set by a jailed
process.  It is trivial to support this option in VNET jails, but it's
also useful in traditional jails.

This patch enables LB groups in jails with the following semantics:
- all PCBs in a group must belong to the same jail,
- PCB lookup prefers jailed groups to non-jailed groups

This is a straightforward extension of the semantics used for individual
listening sockets.  One pre-existing quirk of the lbgroup implementation
is that non-jailed lbgroups are searched before jailed listening
sockets; that is preserved with this change.

Discussed with: glebius
MFC after: 1 month
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37029

(cherry picked from commit d93ec8cb1324d04d7cae19fb7fa98ade2ff33c80)
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet6/in6_pcb.c