{"record":{"id":"1c7418dc7915fb91","repo":"cloudflare/cloudflared","slug":"cannot-send-icmpv6-using-icmpv4-proxy","errorCode":null,"errorMessage":"cannot send ICMPv6 using ICMPv4 proxy","messagePattern":"cannot send ICMPv6 using ICMPv4 proxy","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/icmp_windows.go","lineNumber":334,"sourceCode":"\t\t\tTTL:      packet.DefaultTTL,\n\t\t},\n\t\tMessage: &icmp.Message{\n\t\t\tType: replyType,\n\t\t\tCode: icmpEchoReplyCode,\n\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","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/icmp_windows.go#L316-L352","documentation":"On Windows the ICMP proxy picks either the ICMPv4 IcmpSendEcho API path or the ICMPv6 Icmp6SendEcho path based on how its source socket was opened. icmpEchoRoundtrip raises this error when an ICMPv6 packet arrives but the proxy was created for IPv4 only (srcSocketAddr is nil), so it cannot handle v6 echo requests.","triggerScenarios":"icmpProxy.Request -> icmpEchoRoundtrip with dst being an IPv6 address while the proxy instance has no ICMPv6 source socket (ip.srcSocketAddr == nil).","commonSituations":"Tunnel origin resolving to an AAAA record (IPv6) while cloudflared's Windows ICMP proxy was set up for IPv4; mixed dual-stack traffic routed to a v4-only proxy instance.","solutions":["Ensure the proxy is initialized for IPv6 as well so srcSocketAddr is set (check how cloudflared was launched and which local ICMP socket it bound).","Force the origin/destination to resolve to an IPv4 address (use A records or an IPv4 address for the tunneled host) so requests match the ICMPv4 proxy.","Restart cloudflared on a host/network with IPv6 connectivity so the ICMPv6 path can be established.","Check Windows network stack and firewall to confirm ICMPv6 is available if v6 routing is intended."],"exampleFix":"// before: proxy created v4-only, request dst = 2001:db8::1 -> error\n// after: route an IPv4 destination to the v4 proxy\nresp, err := proxy.Request(ctx, icmpPacketTo(ipv4Dst), responder)","handlingStrategy":"validation","validationCode":"if pkt.Dst.Is6() && proxy.SrcSocketAddr == nil {\n    // resolve to IPv4 or re-init proxy with ICMPv6 socket before calling Request\n}","typeGuard":"func proxySupportsIPv6(p *icmpProxy) bool { return p.srcSocketAddr != nil }\n// call only when dst.Is6() && proxySupportsIPv6(ip)","tryCatchPattern":"resp, err := proxy.Request(ctx, pkt, responder)\nif err != nil && strings.Contains(err.Error(), \"cannot send ICMPv6 using ICMPv4 proxy\") {\n    return nil, errors.New(\"destination is IPv6 but ICMP proxy is IPv4-only; use an IPv4 target or re-init proxy\")\n}","preventionTips":["Match destination address family to the proxy's bound socket family before sending.","Set up both ICMPv4 and ICMPv6 sockets when dual-stack traffic is expected.","Pin tunnel origins to IPv4 (A records) if only the v4 proxy is available.","Log the bound socket family at proxy startup to catch mismatches early."],"tags":["icmp","windows","ipv6","address-family","cloudflared"],"backgroundTag":"invalid-argument-value","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}