add
This commit is contained in:
1 parent
f6e315ba37
commit
2fda6b845c
1 file changed
+4
-8
+4
-8
@@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user