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