{"record":{"id":"4472da2451d9d7bb","repo":"cloudflare/cloudflared","slug":"failed-to-send-receive-icmpv4-echo","errorCode":null,"errorMessage":"failed to send/receive ICMPv4 echo","messagePattern":"failed to send/receive ICMPv4 echo","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/icmp_windows.go","lineNumber":348,"sourceCode":"\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\n- RequestData: A pointer to echo data\n- RequestSize: Number of bytes in buffer pointed by echo data\n- RequestOptions: IP header options\n- ReplyBuffer: A pointer to the buffer for echoReply, options and data\n- ReplySize: Number of bytes allocated for ReplyBuffer\n- Timeout: Timeout in milliseconds to wait for a reply\nReturns:\n- the number of replies in uint32 https://docs.microsoft.com/en-us/windows/win32/api/icmpapi/nf-icmpapi-icmpsendecho#return-value\nTo retain the reference allocated objects, conversion from pointer to uintptr must happen as arguments to the","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/icmp_windows.go#L330-L366","documentation":"icmpEchoRoundtrip wraps failures from the ICMPv4 Windows API (IcmpSendEcho) with 'failed to send/receive ICMPv4 echo'. Any non-success from the Win32 roundtrip — API error, unreachable host, blocked ICMP — is surfaced through this message.","triggerScenarios":"Request() on an ICMPv4 proxy where icmpSendEcho returns 0 replies: destination unreachable, IcmpCreateFile/IcmpSendEcho parameter failure, or the echo request timed out.","commonSituations":"Pinging hosts behind firewalls that drop ICMP, pinging non-existent addresses, running inside containers/NATs that block ICMP, or Windows privilege issues for raw ICMP sockets.","solutions":["Confirm the destination replies to ICMP with the OS `ping` command.","Check firewall/NAT rules that drop outbound ICMP echo requests.","Verify the destination IP is correct and reachable on the current network.","Inspect the inner error/status from IcmpSendEcho for the specific Win32 failure code."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before probing, verify the destination is a reachable IPv4 address\nip := net.ParseIP(dstIP)\nif ip == nil || ip.To4() == nil {\n\t// reject before calling the ICMP proxy\n}","typeGuard":null,"tryCatchPattern":"// Go: retry transient ICMP failures with a deadline\nvar resp *echoResp\nvar err error\nfor i := 0; i < 3 && ctx.Err() == nil; i++ {\n\tresp, err = proxy.Request(ctx, dst, echo)\n\tif err == nil {\n\t\tbreak\n\t}\n\ttime.Sleep(500 * time.Millisecond)\n}","preventionTips":["Confirm the target answers ICMP via the OS ping tool first.","Avoid ICMP probes to endpoints known to drop ICMP; use HTTP health checks instead.","Check NAT/firewall ICMP policies on the path."],"tags":["icmp","windows","icmpv4","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"}