Skip to content

Commit

Permalink
[opensprinkler] Fix hardcoded network prefix (openhab#8456)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
  • Loading branch information
mlobstein authored and andrewfg committed Oct 8, 2020
1 parent 72a3fa6 commit 5b0119d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class OpenSprinklerBindingConstants {

public static final int DEFAULT_WAIT_BEFORE_INITIAL_REFRESH = 30;
public static final int DEFAULT_REFRESH_RATE = 60;
public static final short DISCOVERY_SUBNET_MASK = 24;
public static final int DISCOVERY_THREAD_POOL_SIZE = 15;
public static final boolean DISCOVERY_DEFAULT_AUTO_DISCOVER = false;
public static final int DISCOVERY_DEFAULT_TIMEOUT_RATE = 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private List<String> getIpAddressScanList() throws UnknownHostException, SocketE
for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
InetAddress ipAddress = address.getAddress();

String cidrSubnet = ipAddress.getHostAddress() + "/" + DISCOVERY_SUBNET_MASK;
String cidrSubnet = ipAddress.getHostAddress() + "/" + address.getNetworkPrefixLength();

/* Apache Subnet Utils only supports IP v4 for creating string list of IP's */
if (ipAddress instanceof Inet4Address) {
Expand Down

0 comments on commit 5b0119d

Please sign in to comment.