Skip to content

[Consomme] Windows → WSL localhost relay drops IPv6: SYNs arrive with src ::1 on loopback0 and are discarded, so localhost hangs #41860

Open

Description

@jbclink

Windows Version

Microsoft Windows [Version 10.0.26200.9448]

WSL Version

3.0.1.0

Are you using WSL 1, WSL 2, or WSLC?

  • WSL 2
  • WSL 1
  • WSLC

Kernel Version

6.18.40.1-1

Distro Version

Ubuntu 22.04.5 LTS

Other Software

  • .wslconfig: [wsl2] / networkingMode=consomme (no other settings; wslinfo --networking-mode reports consomme)
  • Docker Engine 29.9.0 inside the distro. This is where the problem was first noticed, but it is not needed to reproduce. The repro below uses only Python's standard library.
  • A corporate network/proxy client was turned off for a retest, with an identical result.

This worked on WSL 2.7.x with networkingMode=VirtioProxy.

Repro Steps

  1. Inside WSL, start three test listeners with the script in Diagnostic Logs → listeners.py (Python stdlib, exits after 90 s):
    • port 8097: two sockets, 0.0.0.0 plus [::] with IPV6_V6ONLY=1 (how Docker publishes ports)
    • port 8098: one dual-stack [::] socket (IPV6_V6ONLY=0)
    • port 8099: 0.0.0.0 only
  2. From Windows (PowerShell), request each port via localhost, 127.0.0.1 and [::1]:
    foreach ($p in 8097, 8098, 8099) {
      foreach ($h in 'localhost', '127.0.0.1', '[::1]') {
        curl.exe -s -o NUL -w "$p $h HTTP %{http_code} via %{remote_ip} in %{time_total}s`n" --max-time 8 ('http://' + $h + ':' + $p + '/')
      }
    }
  3. Optionally, capture inside WSL while sending one [::1] and one 127.0.0.1 request (script in Diagnostic Logs → capture).

Expected Behavior

A connection to [::1]:<port> on Windows reaches the guest's IPv6 listener through the localhost relay, the same way 127.0.0.1:<port> reaches the IPv4 listener. If IPv6 localhost forwarding isn't supported in Consomme, the relay should not listen on ::1 at all, so that clients get an immediate refusal and fall back to IPv4.

Actual Behavior

The Windows relay (dllhost.exe) listens on ::1 and accepts the TCP connection, but nothing is ever returned. Windows resolves localhost to ::1 first, and because the connection is accepted, browsers (Chrome, Edge) and curl never fall back to IPv4. http://localhost:<port> hangs while http://127.0.0.1:<port> works.

Port WSL listener Relay listens on (Windows) localhost 127.0.0.1 [::1]
8097 0.0.0.0 + [::] V6ONLY ::1, ::, 127.0.0.1, 0.0.0.0 timeout 8 s via ::1 200 timeout 8 s
8098 dual-stack [::] ::1, :: timeout 8 s refused timeout 8 s
8099 0.0.0.0 127.0.0.1, 0.0.0.0 200 via 127.0.0.1 200 refused

Inside WSL, curl http://[::1]:8097/ and curl http://[::1]:8098/ both return 200 in about 1 ms, so the guest listeners themselves are fine.

Where the packets die (packet capture + kernel counters): Relay traffic enters the guest on loopback0. IPv4 arrives as 127.0.0.1 → 127.0.0.1 and completes, which is allowed because WSL sets net.ipv4.conf.loopback0.route_localnet=1. IPv6 arrives as src ::1 → dst fe80::<loopback0 link-local>. The guest never answers it (only SYN retransmits appear), and /proc/net/dev_snmp6/loopback0 shows Ip6InHdrErrors = 136 of Ip6InReceives = 137. Linux drops IPv6 packets with a loopback source arriving on a non-loopback interface (RFC 4291 §2.5.3), and IPv6 has no route_localnet equivalent. So every IPv6 relay packet is discarded before TCP sees it, while the Windows side has already completed the client's handshake.

This looks like the gap that the unmerged #40900 ("support ipv6 localhost relay in Consomme networking mode", a loopback6_relay BPF program) was meant to close. A fix would be to source relayed IPv6 traffic from a non-loopback address (for example loopback0's own address, which is already used as the destination), or to stop listening on ::1 on the Windows side until IPv6 relay is supported.

Workaround: bind services or Docker port mappings to IPv4 only (e.g. 0.0.0.0:8080:8080). The relay then doesn't listen on ::1, the IPv6 attempt is refused immediately, and localhost falls back to 127.0.0.1.

Possibly related: inside WSL, the dual-stack socket on 8098 refuses IPv4 (curl http://127.0.0.1:8098/ fails immediately) even with net.ipv6.bindv6only = 0, which plain Linux accepts. That may be the same port-tracking family as #41836 / #41117.

Diagnostic Logs

listeners.py (run inside WSL)
"""Start three test HTTP listeners for 90s to reproduce the Consomme ::1 relay hang.

8097: two separate sockets, 0.0.0.0 + [::] with IPV6_V6ONLY=1 (how Docker publishes ports)
8098: one dual-stack socket on [::] (IPV6_V6ONLY=0)
8099: IPv4 only on 0.0.0.0
"""
import http.server
import socket
import threading
import time


class V6OnlyServer(http.server.HTTPServer):
    address_family = socket.AF_INET6

    def server_bind(self):
        self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
        super().server_bind()


class DualStackServer(http.server.HTTPServer):
    address_family = socket.AF_INET6

    def server_bind(self):
        self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
        super().server_bind()


class QuietHandler(http.server.SimpleHTTPRequestHandler):
    def log_message(self, *args):
        pass


servers = [
    http.server.HTTPServer(("0.0.0.0", 8097), QuietHandler),
    V6OnlyServer(("::", 8097), QuietHandler),
    DualStackServer(("::", 8098), QuietHandler),
    http.server.HTTPServer(("0.0.0.0", 8099), QuietHandler),
]
for s in servers:
    threading.Thread(target=s.serve_forever, daemon=True).start()
time.sleep(90)
Listener state inside WSL and from Windows
# inside WSL: ss -ltn '( sport = :8097 or sport = :8098 or sport = :8099 )'
State  Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0      5            0.0.0.0:8099      0.0.0.0:*
LISTEN 0      5            0.0.0.0:8097      0.0.0.0:*
LISTEN 0      5                  *:8098            *:*
LISTEN 0      5               [::]:8097         [::]:*

# inside WSL: curl
8097 127.0.0.1  HTTP 200 in 0.004380s
8097 [::1]      HTTP 200 in 0.000659s
8098 127.0.0.1  HTTP 000 in 0.026306s
8098 [::1]      HTTP 200 in 0.000831s
8099 127.0.0.1  HTTP 200 in 0.004120s
8099 [::1]      HTTP 000 in 0.000068s

# Windows: Get-NetTCPConnection -State Listen (all owned by dllhost.exe) + curl.exe
== port 8097  relay listens on: ::1, ::, 127.0.0.1, 0.0.0.0
  localhost  HTTP 000 via ::1 in 8.014737s
  127.0.0.1  HTTP 200 via 127.0.0.1 in 0.019765s
  [::1]      HTTP 000 via ::1 in 8.007542s
== port 8098  relay listens on: ::1, ::
  localhost  HTTP 000 via ::1 in 8.008179s
  127.0.0.1  HTTP 000 via  in 2.054936s
  [::1]      HTTP 000 via ::1 in 8.010659s
== port 8099  relay listens on: 127.0.0.1, 0.0.0.0
  localhost  HTTP 200 via 127.0.0.1 in 0.230356s
  127.0.0.1  HTTP 200 via 127.0.0.1 in 0.017731s
  [::1]      HTTP 000 via  in 2.019880s
Packet capture inside WSL (tcpdump -i any -nn 'tcp port 8097') while Windows sent two [::1] requests and one 127.0.0.1 request
# Windows side
[::1]      HTTP 000 via ::1 in 5.002942s
[::1]      HTTP 000 via ::1 in 5.002986s
127.0.0.1  HTTP 200 via 127.0.0.1 in 0.002518s

# guest side
loopback0 In  IP6 ::1.54151 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 1844081424, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54151 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 1844081424, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54151 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 1844081424, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54155 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 3921064078, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54155 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 3921064078, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54151 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 1844081424, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP6 ::1.54155 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 3921064078, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 In  IP 127.0.0.1.54158 > 127.0.0.1.8097: Flags [S], seq 1667282112, win 0, options [mss 65535,wscale 7,eol], length 0
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [S.], seq 1048927850, ack 1667282113, win 64240, options [mss 1460,nop,wscale 10], length 0
loopback0 In  IP 127.0.0.1.54158 > 127.0.0.1.8097: Flags [.], ack 1, win 128, length 0
loopback0 In  IP 127.0.0.1.54158 > 127.0.0.1.8097: Flags [P.], seq 1:79, ack 1, win 128, length 78
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [.], ack 79, win 63, length 0
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [P.], seq 1:158, ack 79, win 63, length 157
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [.], seq 158:1618, ack 79, win 63, length 1460
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [FP.], seq 1618:2752, ack 79, win 63, length 1134
loopback0 In  IP 127.0.0.1.54158 > 127.0.0.1.8097: Flags [.], ack 2753, win 106, length 0
loopback0 In  IP 127.0.0.1.54158 > 127.0.0.1.8097: Flags [F.], seq 79, ack 2753, win 128, length 0
loopback0 Out IP 127.0.0.1.8097 > 127.0.0.1.54158: Flags [.], ack 80, win 63, length 0
loopback0 In  IP6 ::1.54155 > fe80::211:22ff:fe33:4455.8097: Flags [S], seq 3921064078, win 0, options [mss 65535,wscale 7,eol], length 0
Kernel IPv6 counters and guest network config
# /proc/net/dev_snmp6/loopback0 after the tests
Ip6InReceives                   	137
Ip6InHdrErrors                  	136
Ip6InDelivers                   	9

# /proc/net/snmp6 (global)
Ip6InReceives                   	221
Ip6InHdrErrors                  	136
Ip6InDelivers                   	85

# sysctl
net.ipv6.bindv6only = 0
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv4.conf.loopback0.route_localnet = 1
net.ipv4.conf.all.route_localnet = 0

# ip -br addr (lo, loopback0)
lo               UNKNOWN        127.0.0.1/8 ::1/128
loopback0        UP             169.254.73.250/28 2001:abcd::211:22ff:fe33:4455/64 fe80::211:22ff:fe33:4455/64

# ip6tables / nft: only Docker's default chains; no IPv6 rules and nothing matching the test ports

Networking logs from collect-networking-logs.ps1 can be provided on request.

Activity

  1. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    Logs are required for review from WSL team

    If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
    Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

    How to collect WSL logs

    Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

    Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
    Set-ExecutionPolicy Bypass -Scope Process -Force
    .\collect-wsl-logs.ps1
    

    The script will output the path of the log file once done.

    If this is a networking issue, please use .\collect-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues

    Once completed please upload the output files to this GitHub issue.

    See Collect WSL logs (recommended method).

    If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.

  2. jbclink commented on Oct 10, 2026

    @jbclink
    Author

    /emailed-logs

    Networking logs collected with collect-wsl-logs.ps1 -LogProfile networking (WslLogs-2026-10-09_19-51-54.tar.gz, 172 MB, too large to attach here) were sent to [email protected] as a download link.

    The repro ran while capture was active: the listeners from the issue (ports 8097–8099) were up and Windows sent requests every 5 seconds. During the capture, http://[::1]:8097 and http://localhost:8097 timed out (connected via ::1), while http://127.0.0.1:8097 returned 200 (rounds 4–9, 19:52:35–19:53:41 UTC-6).

  3. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor
    Diagnostic information
    Found '/emailed-logs', adding tag 'emailed-logs'
    
  4. added
    emailed-logs
    on Oct 10, 2026
  5. added
    wsl2
    on Oct 12, 2026
  6. jbclink commented on Nov 11, 2026

    @jbclink
    Author

    Still reproduces on WSL 3.0.5 (the "Fix ipv4 mapped ipv6 address handling in consomme mode" change in that release didn't fix it).

    Environment: WSL 3.0.5.0, kernel 6.18.58.1-1, Windows 10.0.26200.9448, networkingMode=consomme

    Repro (2026-11-10): in the guest, run python3 -m http.server 8097 --bind ::. Then from Windows:

    URL Result
    http://[::1]:8097/ timeout (curl exit 28 after 6 s)
    http://localhost:8097/ timeout (curl exit 28 after 6 s)
    http://127.0.0.1:8097/ connection refused (curl exit 7)

    Get-NetTCPConnection -LocalPort 8097 -State Listen shows the relay listening only on ::1 and ::, the same as on 3.0.1. The IPv6 loopback path still accepts on the Windows side and never gets a response from the guest.

    I'm still working around it by publishing container ports IPv4-only (0.0.0.0:<port>:<port>). With that binding the relay listens on IPv4 only, so localhost falls back from ::1 to 127.0.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    emailed-logsnetworkwsl2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions