diff --git a/src/net/azib/ipscan/core/net/WindowsPinger.java b/src/net/azib/ipscan/core/net/WindowsPinger.java index 80c612cf..b14a156f 100644 --- a/src/net/azib/ipscan/core/net/WindowsPinger.java +++ b/src/net/azib/ipscan/core/net/WindowsPinger.java @@ -62,9 +62,13 @@ public class WindowsPinger implements Pinger { for (int i = 1; i <= count && !currentThread().isInterrupted(); i++) { int numReplies = dll.IcmpSendEcho(handle, ipaddr, sendData, (short) sendDataSize, null, replyData, replyDataSize, timeout); IcmpEchoReply echoReply = new IcmpEchoReply(replyData); - if (numReplies > 0 && echoReply.status == 0 && Arrays.equals(echoReply.address.bytes, ipaddr.bytes)) { - result.addReply(echoReply.roundTripTime); - result.setTTL(echoReply.options.ttl & 0xFF); + if (numReplies > 0) { + if (echoReply.status == 0) { + if (Arrays.equals(echoReply.address.bytes, ipaddr.bytes)) { + result.addReply(echoReply.roundTripTime); + result.setTTL(echoReply.options.ttl & 0xFF); + } + } } } }