add
This commit is contained in:
parent
f6e315ba37
commit
2fda6b845c
@ -80,16 +80,12 @@ func recvICMP(conn icmp.PacketConn, recv chan<- *Packet) {
|
||||
n, srcaddr, err := conn.ReadFrom(bytes)
|
||||
|
||||
if err != nil {
|
||||
if neterr, ok := err.(*net.OpError); ok {
|
||||
if neterr.Timeout() {
|
||||
// Read timeout
|
||||
continue
|
||||
} else {
|
||||
nerr, ok := err.(net.Error)
|
||||
if !ok || !nerr.Timeout() {
|
||||
loggo.Error("Error read icmp message %s", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echoId := int(binary.BigEndian.Uint16(bytes[4:6]))
|
||||
echoSeq := int(binary.BigEndian.Uint16(bytes[6:8]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user