AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 25 Bitcoin

connectd: set IPV6_V6ONLY=1 on IPv6 sockets for consistent dual-stack behaviour

Public commit record

What the developer wrote

Authored by Níckolas Goline

85/100 · Strong
connectd: set IPV6_V6ONLY=1 on IPv6 sockets for consistent dual-stack behaviour

Systems with net.ipv6.bindv6only=0 (macOS, Fedora, Arch, vanilla kernels) create dual-stack sockets by default: binding '::' also covers '0.0.0.0', so the subsequent IPv4 wildcard bind fails with EADDRINUSE. Debian/Ubuntu ship bindv6only=1 so both binds succeed here, which is why this was never noticed on typical Linux CI.

Explicitly set IPV6_V6ONLY=1 on AF_INET6 sockets before bind so both address families always get independent sockets regardless of the system sysctl. Also free the errstr allocation left behind when the IPv4 bind fails acceptably (IPv6 succeeded), fixing a memleak in connectd on those systems.

test_ipv4_and_ipv6: accept IPv6-only binding in the single-socket case, which can still occur on IPv4-only hosts.

Changelog-Fixed: connectd: on macOS and other systems with dual-stack IPv6 default, wildcard '--addr=:<port>' now correctly binds both IPv4 and IPv6.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a network setup bug in Core Lightning's connection daemon. On some operating systems (macOS, Fedora, Arch, and default Linux kernels), an IPv6 'listen on all addresses' socket was also covering IPv4, which prevented a separate IPv4 socket from starting and could leak a small amount of memory when the IPv4 bind failed. The patch forces IPv6 sockets to be IPv6-only before binding, so IPv4 and IPv6 listeners are always created independently, and it frees an unused error message to stop the memory leak. It is a reliability/availability fix, not a direct remote exploit.

Recommended action

Treat as a routine bug fix. Apply the patch to ensure consistent dual-stack listener behavior across platforms and to eliminate the connectd memory leak on affected systems. No emergency response is indicated.

Security signals we found

01

Denial-of-service availability fix: on affected systems, the node could not listen on IPv4 when configured for wildcard IPv4+IPv6

02

Memory leak fix in connectd error path

03

No evidence of malicious intent in the diff

Risk score

Why this scored 25/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 2/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.