From 35d565af651554c18f7a62366fefd7812fbda459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 23 Mar 2023 15:33:25 +0800 Subject: [PATCH] Fix icmp constant --- system.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.go b/system.go index a857b3a..e3e77eb 100644 --- a/system.go +++ b/system.go @@ -402,7 +402,7 @@ func (s *System) processIPv6UDP(packet clashtcpip.IPv6Packet, header clashtcpip. func (s *System) processIPv4ICMP(packet clashtcpip.IPv4Packet, header clashtcpip.ICMPPacket) error { if s.router != nil { - routeSession := RouteSession{4, syscall.IPPROTO_ICMP, netip.AddrPortFrom(packet.SourceIP(), 0), netip.AddrPortFrom(packet.DestinationIP(), 0)} + routeSession := RouteSession{4, clashtcpip.ICMP, netip.AddrPortFrom(packet.SourceIP(), 0), netip.AddrPortFrom(packet.DestinationIP(), 0)} action := s.routeMapping.Lookup(routeSession, func() RouteAction { return s.router.RouteConnection(routeSession, &systemICMPDirectPacketWriter4{s.tun, packet.SourceIP()}) }) @@ -430,7 +430,7 @@ func (s *System) processIPv4ICMP(packet clashtcpip.IPv4Packet, header clashtcpip func (s *System) processIPv6ICMP(packet clashtcpip.IPv6Packet, header clashtcpip.ICMPv6Packet) error { if s.router != nil { - routeSession := RouteSession{6, syscall.IPPROTO_ICMPV6, netip.AddrPortFrom(packet.SourceIP(), 0), netip.AddrPortFrom(packet.DestinationIP(), 0)} + routeSession := RouteSession{6, clashtcpip.ICMPv6, netip.AddrPortFrom(packet.SourceIP(), 0), netip.AddrPortFrom(packet.DestinationIP(), 0)} action := s.routeMapping.Lookup(routeSession, func() RouteAction { return s.router.RouteConnection(routeSession, &systemICMPDirectPacketWriter6{s.tun, packet.SourceIP()}) })