We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7eabe56 + cd41888 commit 91b8dceCopy full SHA for 91b8dce
library/src/main/java/com/stealthcopter/networktools/SubnetDevices.java
@@ -70,9 +70,10 @@ public static SubnetDevices fromIPAddress(@NonNull final String ipAddress) {
70
subnetDevice.addresses.addAll(ARPInfo.getAllIPAddressesInARPCache());
71
72
// Add all missing addresses in subnet
73
+ String segment = ipAddress.substring(0, ipAddress.lastIndexOf(".") + 1);
74
for (int j = 0; j < 255; j++) {
- if (!subnetDevice.addresses.contains(ipAddress + j)) {
75
- subnetDevice.addresses.add(ipAddress + j);
+ if (!subnetDevice.addresses.contains(segment + j)) {
76
+ subnetDevice.addresses.add(segment + j);
77
}
78
79
@@ -160,4 +161,4 @@ public void run() {
160
161
162
163
-}
164
+}
0 commit comments