https://issues.apache.org/jira/browse/AMQ-5520 - fix org.apache.activemq.spring.SpringTest.testSenderWithSpringXmlEmbeddedPooledBrokerConfiguredViaXml regression

This commit is contained in:
gtully 2015-02-11 15:51:55 +00:00
parent 25376afac1
commit 07338e7553
1 changed files with 10 additions and 8 deletions

View File

@ -344,16 +344,18 @@ public class MulticastDiscoveryAgent implements DiscoveryAgent, Runnable {
List<NetworkInterface> possibles = new ArrayList<NetworkInterface>();
while (ifcs.hasMoreElements()) {
NetworkInterface ni = ifcs.nextElement();
if (ni.supportsMulticast()
&& ni.isUp()) {
for (InterfaceAddress ia : ni.getInterfaceAddresses()) {
if (ia.getAddress() instanceof java.net.Inet4Address
&& !ia.getAddress().isLoopbackAddress()
&& !ni.getDisplayName().startsWith("vnic")) {
possibles.add(ni);
try {
if (ni.supportsMulticast()
&& ni.isUp()) {
for (InterfaceAddress ia : ni.getInterfaceAddresses()) {
if (ia.getAddress() instanceof java.net.Inet4Address
&& !ia.getAddress().isLoopbackAddress()
&& !ni.getDisplayName().startsWith("vnic")) {
possibles.add(ni);
}
}
}
}
} catch (SocketException ignored) {}
}
return possibles.isEmpty() ? null : possibles.get(possibles.size() - 1);
}