{"record":{"id":"51f7c7e1ae687b60","repo":"cloudflare/cloudflared","slug":"failed-to-send-receive-icmpv6-echo","errorCode":null,"errorMessage":"failed to send/receive ICMPv6 echo","messagePattern":"failed to send/receive ICMPv6 echo","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/icmp_windows.go","lineNumber":339,"sourceCode":"\t\t\tBody: &icmp.Echo{\n\t\t\t\tID:   echoReq.ID,\n\t\t\t\tSeq:  echoReq.Seq,\n\t\t\t\tData: resp.payload(),\n\t\t\t},\n\t\t},\n\t}\n\treturn responder.ReturnPacket(&pk)\n}\n\nfunc (ip *icmpProxy) icmpEchoRoundtrip(dst netip.Addr, echo *icmp.Echo) (echoResp, error) {\n\tif dst.Is6() {\n\t\tif ip.srcSocketAddr == nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot send ICMPv6 using ICMPv4 proxy\")\n\t\t}\n\t\tresp, err := ip.icmp6SendEcho(dst, echo)\n\t\tif err != nil {\n\n\t\t\treturn nil, errors.Wrap(err, \"failed to send/receive ICMPv6 echo\")\n\t\t}\n\t\treturn resp, nil\n\t}\n\tif ip.srcSocketAddr != nil {\n\t\treturn nil, fmt.Errorf(\"cannot send ICMPv4 using ICMPv6 proxy\")\n\t}\n\tresp, err := ip.icmpSendEcho(dst, echo)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to send/receive ICMPv4 echo\")\n\t}\n\treturn resp, nil\n}\n\n/*\nWrapper to call https://docs.microsoft.com/en-us/windows/win32/api/icmpapi/nf-icmpapi-icmpsendecho\nParameters:\n- IcmpHandle: Handle created by IcmpCreateFile\n- DestinationAddress: IPv4 in the form of https://docs.microsoft.com/en-us/windows/win32/api/inaddr/ns-inaddr-in_addr#syntax","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/icmp_windows.go#L321-L357","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify IPv6 connectivity to the destination (test with the OS `ping -6`).","Allow ICMPv6 echo in Windows Firewall (File and Printer Sharing / ICMPv6 rules).","Confirm the source address assigned to the proxy still exists on a network interface.","Retry; transient loss still surfaces through this wrapper — check the inner status for details."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before probing, verify IPv6 connectivity\naddrs, err := net.InterfaceAddrs()\nhasV6 := false\nfor _, a := range addrs {\n\tif ip := a.(*net.IPNet).IP; ip.To16() != nil && ip.To4() == nil && ip.IsGlobalUnicast() {\n\t\thasV6 = true\n\t}\n}\nif !hasV6 {\n\t// skip ICMPv6 probe; no IPv6 connectivity\n}","typeGuard":null,"tryCatchPattern":"// Go: wrap the probe with a bounded retry\nvar resp *echoResp\nvar err error\nfor i := 0; i < 3; i++ {\n\tresp, err = proxy.Request(ctx, dst, echo)\n\tif err == nil || !strings.Contains(err.Error(), \"failed to send/receive ICMPv6 echo\") {\n\t\tbreak\n\t}\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase <-time.After(time.Second):\n\t}\n}","preventionTips":["Check OS-level `ping -6` works before relying on ICMPv6 probes.","Allow ICMPv6 in Windows Firewall profiles.","Handle probe failures gracefully in health-check logic instead of failing fast."],"tags":["icmp","windows","icmpv6","network"],"backgroundTag":"network-request-failed","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}