Skip to content

macOS (App Store variant, IPNExtension): after a network change, direct UDP connections never re-establish. Peers stay on DERP indefinitely until the Tailscale app is quit and relaunched. #22082

Closed as duplicate

Description

@fberger2

macOS (App Store variant, IPNExtension): after a network change, direct UDP connections never re-establish. Peers stay on DERP indefinitely until the Tailscale app is quit and relaunched.

Reproduction (reliable):

  1. Mac on office LAN, tailscale status shows peer subnet-router as active; direct 192.0.2.3:41641
  2. Switch Wi-Fi to a mobile phone hotspot
  3. ~50 s later: active; relay "fra", tailscale ping ends with direct connection not established – permanently
  4. tailscale down && tailscale up → no change
  5. tailscale debug rebind + tailscale debug restun → no change
  6. Quit app + relaunch → immediately pong ... via 203.0.113.22:41641

Evidence that packets reach the Mac but are not processed by magicsock:

  • tcpdump on the peer's WAN interface (FreeBSD-based firewall, static outbound NAT on UDP 41641): disco pings from the Mac arrive, the peer answers every ping with a pong (110 bytes) to the correct src IP:port, the peer also sends its own pings (124 bytes)
  • tcpdump on the Mac's en0 (same time): all pongs AND pings from the peer arrive on en0
  • The Mac never sends a single pong back (no 110-byte packets outbound)
  • Unified log of IPNExtension shows only magicsock: new contact: peer=[...] via=derp, never via=udp, and no disco errors (no "failed to open", no "unknown disco key")
  • lsof -iUDP:41641: only IPNExtension bound, no port conflict
  • Ruled out: macOS application firewall (off), third-party firewall network extension (disabled), EDR network extension (disabled), home router (reproduced on two different networks: residential cable connection and mobile carrier hotspot)
  • Other clients reach the same peer directly at the same time

Possibly related: right after the network change, MagicDNS lookups briefly fail (lookup <hostname>: no such host) – similar to #21154 (post-wake/link-change routing issue in the macOS extension).

OS / version

  • macOS [27.2], Apple Silicon
  • Tailscale 1.104.2 (App Store variant, process IPNExtension)
  • Peer: Tailscale on a FreeBSD-based firewall acting as subnet router, fixed port 41641, static outbound NAT

Bug report

BUG-4fcdbdb13fd0c0e234717b75d37d35fad98535799156a64e0341c30370521ead-20261030094050Z-cf214da6b686c6c5 (taken while in the stuck state, before restarting the app)

Steps to reproduce

  1. Mac connected to office LAN, establish traffic to a peer (subnet router). tailscale status shows active; direct <LAN-IP>:41641
  2. Switch Wi-Fi to a different network (e.g. mobile phone hotspot)
  3. Within ~1 minute the peer shows active; relay "fra"
  4. tailscale ping <peer> ends with direct connection not established – stays like this indefinitely (tested for > 30 min)
  5. tailscale down && tailscale up → no change
  6. tailscale debug rebind + tailscale debug restun → no change
  7. Quit Tailscale app and relaunch → direct connection immediately established

Reproducible on every network change on two different Macs.

Are there any recent changes that introduced the issue?

Not known. First noticed on 1.104.2 (App Store variant). Unknown whether earlier versions are affected.
An EDR agent update happened around the same time, but disabling its network extension did not change the behavior.

OS

macOS

OS version

27.2

Tailscale version

1.104.2

Other software

DR network extension, third-party firewall network extension (both disabled during testing – no effect)

Bug report

No response

Activity

  1. ViRb3 commented on Oct 30, 2026

    @ViRb3

    I'm having the same (?) issue with the standalone version of Tailscale and without changing any network. Here is my report to technical support team:

    Issue

    Since updating to macOS 27.2, the warning "The MagicSock function ReceiveIPv4 is not running" appears 1–2 minutes after every tunnel start. From then on no direct connection works and every peer goes through DERP until the app is quit and relaunched. tailscale down/up and tailscale debug rebind do not recover it. ReceiveIPv6 dies the same way, usually within seconds of startup.

    Root cause, from the system log: the macOS content filter (CFIL, active because Little Snitch 6.5's network extension is installed) holds an outbound UDP disco ping, and the kernel re-sends it later. When the destination is unreachable, the delayed send fails with EHOSTUNREACH, and that error is then returned by a later recvfrom() on the same socket. magicsock passes it to wireguard-go's RoutineReceiveIncoming as a non-Temporary error, so the receive goroutine exits and is never restarted. Unreachable destinations here are either a peer's advertised LAN endpoint that collides with my LAN subnet but doesn't exist on it, or any peer's IPv6 endpoint (this Mac has no IPv6 route).

    Every receive-func exit matches a CFIL failure on port 41641 in the same millisecond:

    2026-10-29 21:04:44.550 kernel: CFIL: Error: sosend_reinject() failed ... <UDP(17) out> lport 41641 fport 41641 laddr 0.0.0.0 faddr 192.168.1.251
    2026-10-29 21:04:44.550 kernel: CFIL: sosend() failed 65
    2026-10-29 21:04:44.550 Receive func ReceiveIPv4 exiting with error: *net.OpError, read udp4 0.0.0.0:41641: recvfrom: no route to host

    2026-10-29 03:09:59.717 kernel: CFIL: Error: sosend_reinject() failed ... lport 41641 laddr :: faddr 2001:db8::1
    2026-10-29 03:09:59.717 kernel: CFIL: sosend() failed 65
    2026-10-29 03:09:59.717 Receive func ReceiveIPv6 exiting with error: *net.OpError, read udp6 [::]:41641: recvfrom: no route to host

    Other matches: 02:36:57.718, 03:06:11.709 and 20:41:42.104 (IPv4), and 00:26:17.305 on 2026-10-30 (IPv6). Little Snitch never denied any of this traffic; the filter merely being in the path is enough.

    This looks like #20616 (macOS) and #19504 (iOS), and PR #21396 ("keep receive funcs alive across socket read errors") should fix it.

    Repro

    Requirements: macOS 27.2, Tailscale 1.104.4 standalone, and an active content-filter network extension (Little Snitch 6.5 here).

    IPv6 (reproduces within seconds, nothing special needed):

    1. Use a Mac with no IPv6 connectivity and a peer that advertises an IPv6 endpoint.
    2. Start Tailscale and ping the peer.
    3. ReceiveIPv6 exits with "recvfrom: no route to host" within seconds.

    IPv4 (racy, reproduced on controlplane.tailscale.com with one Linux peer):

    1. On the Mac, ping a non-existent address on the local subnet (e.g. 192.168.1.251) so its ARP lookup is already failing.
    2. On the peer, set TS_DEBUG_PRETENDPOINT=192.168.1.251:41641 and restart tailscaled.
    3. On the peer, drop UDP from the Mac's public IP to port 41641, so the Mac keeps probing every candidate endpoint.
    4. Each new probe flow to the fake address produces a CFIL reinject failure with errno 65. When the receive goroutine picks the error up before a sendto does, ReceiveIPv4 exits permanently.

    On my real tailnet (about 15 peers, several advertising 192.168.1.x LAN endpoints that don't exist on my LAN), ReceiveIPv4 dies 1–2 minutes after every relaunch with no setup needed.

  2. ViRb3 commented on Oct 31, 2026

    @ViRb3
  3. added theissue type on Nov 2, 2026
  4. self-assigned this
    on Nov 5, 2026
  5. bcreane commented on Nov 5, 2026

    @bcreane
    Contributor

    Thanks for the capture. This looks like the same failure as #19504 and #20616: magicsock's UDP receive loop gets a non-temporary read error (EHOSTUNREACH or ENETUNREACH, which a Wi-Fi switch or a content-filter network extension in the path can surface on recvfrom), returns it to wireguard-go, and the receive goroutine exits for good. That matches what you measured. The Mac keeps sending disco pings, the peer's pongs arrive on en0, and nothing reads them. tailscale debug rebind swaps the socket under a reader that is already gone, so it cannot help, and only an app relaunch recovers.

    1.104.5 retries reads that return those two errors instead of handing them to wireguard-go. Please update and retest. If it still reproduces on 1.104.5, please post a fresh bug report ID on #19504, which is the open tracker. Closing this as a duplicate.

  6. fberger2 commented on Nov 6, 2026

    @fberger2
    Author

    Thanks for your reply. We are using the Appstore variant which is 1.104.4 at the moment. We have to wait for an update in appstore.

    I will test asap when 1.104.5 is available.

  7. fberger2 commented on Nov 7, 2026

    @fberger2
    Author

    I just tested tailscale ping to two machines and switching Connection afterwards. Still not working

    Wifi (at home)

    tailscale ping muc-xxxx                                                         
    pong from jeff (xxx.xxx.xxx.xxx) via xx.xx.xx.xx:41641 in 29ms
    

    Switched to mobile hotspot (at home)

    tailscale ping muc-xxx                                                 
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 29ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 24ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 32ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 45ms
    2026/11/07 12:59:36 direct connection not established
    

    Switched back to Wifi (at home)

    tailscale ping muc-xxx                                                 
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 29ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 24ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 25ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 26ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 32ms
    pong from jeff (xxx.xxx.xxx.xxx) via DERP(fra) in 45ms
    2026/11/07 13:03:36 direct connection not established
    

    Quitting Tailscale completely and start it again Wifi (at home)

    tailscale ping muc-xxx                                                 
    pong from jeff (xxx.xxx.xxx.xxx) via x.xx.xx.xx:41641 in 21ms
    
  8. fberger2 commented on Nov 8, 2026

    @fberger2
    Author

    Why was this issue closed? 1.104.5 didn´t fix it.....

  9. bcreane commented on Nov 8, 2026

    @bcreane
    Contributor

    If it still reproduces on 1.104.5, please post a fresh bug report ID on #19504, which is the open tracker. Closing this as a duplicate.

  10. fberger2 commented on Nov 9, 2026

    @fberger2
    Author

    Not fixed in 1.104.5 – same behavior. Opened follow-up: #22259

  11. sfllaw commented on Nov 9, 2026

    @sfllaw
    Contributor

    The root cause of this issue, even though there are different symptoms, is the same as #19504. All related updates will be consolidated on to #19504, so that we can track everything in one place. Thanks for your understanding.

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

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions