You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/01/15 23:56:33 UTC

[3/5] qpid-jms git commit: Exclude possiuble VPN tunnel interface as well.

Exclude possiuble VPN tunnel interface as well. 

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/015280c9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/015280c9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/015280c9

Branch: refs/heads/master
Commit: 015280c99a1fe09ce38adb795ad8229cda86a186
Parents: 1326a6e
Author: Timothy Bish <ta...@gmail.com>
Authored: Thu Jan 15 15:12:39 2015 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Thu Jan 15 15:12:39 2015 -0500

----------------------------------------------------------------------
 .../discovery/multicast/MulticastDiscoveryAgent.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/015280c9/qpid-jms-discovery/src/main/java/org/apache/qpid/jms/provider/discovery/multicast/MulticastDiscoveryAgent.java
----------------------------------------------------------------------
diff --git a/qpid-jms-discovery/src/main/java/org/apache/qpid/jms/provider/discovery/multicast/MulticastDiscoveryAgent.java b/qpid-jms-discovery/src/main/java/org/apache/qpid/jms/provider/discovery/multicast/MulticastDiscoveryAgent.java
index b9ebd31..885f70c 100644
--- a/qpid-jms-discovery/src/main/java/org/apache/qpid/jms/provider/discovery/multicast/MulticastDiscoveryAgent.java
+++ b/qpid-jms-discovery/src/main/java/org/apache/qpid/jms/provider/discovery/multicast/MulticastDiscoveryAgent.java
@@ -59,6 +59,13 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
     private static final int DEFAULT_IDLE_TIME = 500;
     private static final int HEARTBEAT_MISS_BEFORE_DEATH = 10;
 
+    private static final List<String> DEFAULT_EXCLUSIONS = new ArrayList<String>();
+
+    static {
+        DEFAULT_EXCLUSIONS.add("vnic");
+        DEFAULT_EXCLUSIONS.add("tun0");
+    }
+
     private DiscoveryListener listener;
     private URI discoveryURI;
     private int timeToLive = 1;
@@ -387,6 +394,7 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
         for (NetworkInterface networkInterface : interfaces) {
             try {
                 mcastSock.setNetworkInterface(networkInterface);
+                LOG.debug("Configured mcast socket {} to network interface {}", mcast, networkInterface);
                 found = true;
                 break;
             } catch (SocketException error) {
@@ -412,7 +420,7 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
                 for (InterfaceAddress ia : ni.getInterfaceAddresses()) {
                     if (ia.getAddress() instanceof java.net.Inet4Address &&
                         !ia.getAddress().isLoopbackAddress() &&
-                        !ni.getDisplayName().startsWith("vnic")) {
+                        !DEFAULT_EXCLUSIONS.contains(ni.getName())) {
                         interfaces.add(ni);
                     }
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org