You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2019/07/14 14:10:15 UTC

[jmeter] branch master updated: Use a more concise way to filter for IPv4 addresses in the test

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 734794f  Use a more concise way to filter for IPv4 addresses in the test
734794f is described below

commit 734794f027a035ab72af626c022354f197db0f52
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Sun Jul 14 16:10:00 2019 +0200

    Use a more concise way to filter for IPv4 addresses in the test
---
 test/src/org/apache/jmeter/engine/LocalHostTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/src/org/apache/jmeter/engine/LocalHostTest.java b/test/src/org/apache/jmeter/engine/LocalHostTest.java
index e730f34..04d3bc0 100644
--- a/test/src/org/apache/jmeter/engine/LocalHostTest.java
+++ b/test/src/org/apache/jmeter/engine/LocalHostTest.java
@@ -50,7 +50,7 @@ public class LocalHostTest {
         boolean localHostIsBound = Collections
                 .list(NetworkInterface.getNetworkInterfaces()).stream()
                 .flatMap(iface -> iface.getInterfaceAddresses().stream())
-                .filter(iface -> iface.getNetworkPrefixLength() <= 32) // hack to prevent checking IPv6
+                .filter(iface -> iface.getAddress().getAddress().length == 4) // hack to prevent checking IPv6
                 .map(this::toSubnetInfo)
                 .anyMatch(subnetInfo -> subnetInfo.isInRange(localHost));
         Assert.assertTrue(