🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.bugs
2 messages
2 total messages Started by bugzilla-noreply Fri, 13 Nov 2026 06:26
[Bug 300737] netinet: SO_REUSEPORT_LB does not distribute traffic across dual-stack UDP sockets
#442
Author: bugzilla-noreply
Date: Fri, 13 Nov 2026 06:26
105 lines
5035 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300737

            Bug ID: 300737
           Summary: netinet: SO_REUSEPORT_LB does not distribute traffic
                    across dual-stack UDP sockets
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: vim@vimer.org

Created attachment 277248
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=277248&action=edit
dualstack_udp_lb_test.c

Description

When multiple dual-stack UDP sockets enable SO_REUSEPORT_LB and bind to the
same port, setting the socket options and binding succeed, but neither IPv4 nor
IPv6 traffic is load-balanced across the sockets.

This affects multithreaded UDP servers that use one dual-stack socket per
worker and rely on kernel load balancing.

Environment

FreeBSD 16.0-CURRENT main-n290699-c502df9eb193 GENERIC amd64
Kyua 0.15.1

Steps to reproduce

The attached C source contains a test that:

Creates 16 AF_INET6 UDP sockets.
Sets IPV6_V6ONLY=0 and SO_REUSEPORT_LB=1 on each socket.
Binds all sockets to :: and the same automatically allocated port.
Sends traffic to 127.0.0.1 and ::1. For each address family, it creates 512
client sockets, each sending one datagram.
Counts the datagrams received by each server socket.
Compile and run on FreeBSD:

cc -Wall -Wextra -o dualstack_udp_lb_test dualstack_udp_lb_test.c
-lprivateatf-c

cat > Kyuafile <<'EOF'
syntax(2)
test_suite("dualstack_udp_lb")
atf_test_program{name="dualstack_udp_lb_test"}
EOF

kyua test -k Kyuafile -r results.db dualstack_udp_lb_test:dualstack_udp
kyua report -r results.db --verbose

Actual results

Compilation succeeds. All socket option and bind operations succeed.

For both IPv4 and IPv6, all 512 datagrams are received by socket 15. The other
15 sockets receive no datagrams. No datagrams are lost, but no load balancing
occurs.

Kyua reports:

0/1 passed (0 broken, 1 failed, 0 skipped)
failed: 30 checks failed; see output for more details

Expected results

Multiple dual-stack UDP sockets using SO_REUSEPORT_LB should support flow-based
load balancing for both IPv4 and IPv6 traffic.

An exactly equal distribution is not expected, but traffic from multiple
clients should not consistently go to a single receiving socket.

Relevant kernel code

In in_pcbinslbgrouphash(), the function returns success without adding the PCB
to a load-balancing group when all of the following conditions hold:

INP_IPV4 is set;
the local IPv4 address is INADDR_ANY;
the socket address family is AF_INET6.
Dual-stack wildcard sockets meet these conditions. This appears to explain why
setting the options and binding succeed, but no load balancing takes place.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 300737] netinet: SO_REUSEPORT_LB does not distribute traffic across dual-stack UDP sockets
#445
Author: bugzilla-noreply
Date: Fri, 13 Nov 2026 07:26
16 lines
2580 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300737

Mark Linimon <linimon@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |net@FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads