cloudflare/cloudflared · error

failed to send/receive ICMPv6 echo

Error message

failed to send/receive ICMPv6 echo

What it means

On Windows, icmpEchoRoundtrip dispatches to the ICMPv6 Windows API (Icmp6SendEcho) when the proxy was created for IPv6, wrapping any failure from icmp6SendEcho with 'failed to send/receive ICMPv6 echo'. This covers Win32 API failures — invalid handles, bad parameters, or no reply received — during the ICMPv6 echo roundtrip.

Source

Thrown at ingress/icmp_windows.go:339

			Body: &icmp.Echo{
				ID:   echoReq.ID,
				Seq:  echoReq.Seq,
				Data: resp.payload(),
			},
		},
	}
	return responder.ReturnPacket(&pk)
}

func (ip *icmpProxy) icmpEchoRoundtrip(dst netip.Addr, echo *icmp.Echo) (echoResp, error) {
	if dst.Is6() {
		if ip.srcSocketAddr == nil {
			return nil, fmt.Errorf("cannot send ICMPv6 using ICMPv4 proxy")
		}
		resp, err := ip.icmp6SendEcho(dst, echo)
		if err != nil {

			return nil, errors.Wrap(err, "failed to send/receive ICMPv6 echo")
		}
		return resp, nil
	}
	if ip.srcSocketAddr != nil {
		return nil, fmt.Errorf("cannot send ICMPv4 using ICMPv6 proxy")
	}
	resp, err := ip.icmpSendEcho(dst, echo)
	if err != nil {
		return nil, errors.Wrap(err, "failed to send/receive ICMPv4 echo")
	}
	return resp, nil
}

/*
Wrapper to call https://docs.microsoft.com/en-us/windows/win32/api/icmpapi/nf-icmpapi-icmpsendecho
Parameters:
- IcmpHandle: Handle created by IcmpCreateFile
- DestinationAddress: IPv4 in the form of https://docs.microsoft.com/en-us/windows/win32/api/inaddr/ns-inaddr-in_addr#syntax

View on GitHub (pinned to 2253eeeb25)

Solutions

  1. Verify IPv6 connectivity to the destination (test with the OS `ping -6`).
  2. Allow ICMPv6 echo in Windows Firewall (File and Printer Sharing / ICMPv6 rules).
  3. Confirm the source address assigned to the proxy still exists on a network interface.
  4. Retry; transient loss still surfaces through this wrapper — check the inner status for details.
Defensive patterns

Strategy: retry

Validate before calling

// Before probing, verify IPv6 connectivity
addrs, err := net.InterfaceAddrs()
hasV6 := false
for _, a := range addrs {
	if ip := a.(*net.IPNet).IP; ip.To16() != nil && ip.To4() == nil && ip.IsGlobalUnicast() {
		hasV6 = true
	}
}
if !hasV6 {
	// skip ICMPv6 probe; no IPv6 connectivity
}

Try / catch

// Go: wrap the probe with a bounded retry
var resp *echoResp
var err error
for i := 0; i < 3; i++ {
	resp, err = proxy.Request(ctx, dst, echo)
	if err == nil || !strings.Contains(err.Error(), "failed to send/receive ICMPv6 echo") {
		break
	}
	select {
	case <-ctx.Done():
		return ctx.Err()
	case <-time.After(time.Second):
	}
}

Prevention

When it happens

Trigger: Request() on an ICMPv6 proxy where Icmp6SendEcho returns 0: the destination is unreachable, the ICMPv6 socket could not bind to the source address, firewall blocks ICMPv6, or the echo request parameters (dst/echo) are malformed for the IPv6 API.

Common situations: Pinging an IPv6 host from a Windows machine with no IPv6 connectivity, Windows Firewall blocking outbound ICMPv6, or the source address (srcSocketAddr) no longer being valid on the interface.

Related errors


AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06). Data as JSON: /api/errors/51f7c7e1ae687b60. Report an issue: GitHub.