fix bugs:--source and --dev doesn't work on macOS

https://github.com/nxtrace/Ntrace-core/issues/147
This commit is contained in:
tsosunchia
2023-08-16 22:44:18 +08:00
parent cb7bc7450f
commit f3f99ac0aa

View File

@@ -12,7 +12,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/ipv4"
@@ -65,7 +64,7 @@ func (t *ICMPTracer) Execute() (*Result, error) {
var err error
t.icmpListen, err = internal.ListenICMP("ip4:1", t.SrcAddr)
t.icmpListen, err = net.ListenPacket("ip4:1", t.SrcAddr)
if err != nil {
return &t.res, err
}