fix:修复panic恢复机制

This commit is contained in:
spiritlhl committed 2026-05-21 16:11:57 +00:00
1 parent 026f9784e4
commit ce8555f149
11 files changed
+94 -21

No files matched your search

+4 -1
View File
@@ -233,7 +233,10 @@ func (t *Tracer) serveData(from net.IP, b []byte) error {
return err
}
if msg.Type == ipv4.ICMPTypeEchoReply {
echo := msg.Body.(*icmp.Echo)
echo, ok := msg.Body.(*icmp.Echo)
if !ok || echo == nil {
return errUnsupportedProtocol
}
return t.serveReply(from, &packet{from, uint16(echo.ID), 1, time.Now()})
}
b = getReplyData(msg)