From 96671d263cdd8efafd74cdf130f402aeedabbddc Mon Sep 17 00:00:00 2001 From: tsosunchia <59512455+tsosunchia@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:19:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86macos=E4=B8=8Bipv6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=8C=87=E5=AE=9Adev=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trace/icmp_ipv6.go | 3 +-- trace/internal/icmp_darwin.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trace/icmp_ipv6.go b/trace/icmp_ipv6.go index 69bcf90..2f0ffe7 100644 --- a/trace/icmp_ipv6.go +++ b/trace/icmp_ipv6.go @@ -10,7 +10,6 @@ import ( "sync" "time" - "github.com/xgadget-lab/nexttrace/trace/internal" "golang.org/x/net/context" "golang.org/x/net/icmp" "golang.org/x/net/ipv6" @@ -66,7 +65,7 @@ func (t *ICMPTracerv6) Execute() (*Result, error) { var err error - t.icmpListen, err = internal.ListenICMP("ip6:58", t.SrcAddr) + t.icmpListen, err = net.ListenPacket("ip6:58", t.SrcAddr) if err != nil { return &t.res, err } diff --git a/trace/internal/icmp_darwin.go b/trace/internal/icmp_darwin.go index dd2fbe6..435f05d 100644 --- a/trace/internal/icmp_darwin.go +++ b/trace/internal/icmp_darwin.go @@ -28,6 +28,7 @@ var ( } ) +// 会造成指定出口IP功能不可使用 func ListenICMP(network string, laddr string) (net.PacketConn, error) { if os.Getuid() == 0 { // root return net.ListenPacket(network, laddr)