Fixes the address filtering for single-port UDP.

This commit is contained in:
boris 2015-06-02 12:22:32 +00:00
parent 1f4aeebe38
commit 8d96b29382

View File

@ -77,10 +77,12 @@ public class SinglePortUdpHarvester
= new LinkedList<SinglePortUdpHarvester>(); = new LinkedList<SinglePortUdpHarvester>();
List<TransportAddress> addresses = new LinkedList<TransportAddress>(); List<TransportAddress> addresses = new LinkedList<TransportAddress>();
boolean isIPv6Disabled = StackProperties.getBoolean( boolean isIPv6Disabled = StackProperties.getBoolean(
StackProperties.DISABLE_IPv6, StackProperties.DISABLE_IPv6,
false); false);
boolean isIPv6LinkLocalDisabled = StackProperties.getBoolean(
StackProperties.DISABLE_LINK_LOCAL_ADDRESSES,
false);
try try
{ {
@ -100,8 +102,15 @@ public class SinglePortUdpHarvester
{ {
InetAddress address = ifaceAddresses.nextElement(); InetAddress address = ifaceAddresses.nextElement();
if (!HostCandidateHarvester.isAddressAllowed(address))
continue;
if (isIPv6Disabled && address instanceof Inet6Address) if (isIPv6Disabled && address instanceof Inet6Address)
continue; continue;
if (isIPv6LinkLocalDisabled
&& address instanceof Inet6Address
&& address.isLinkLocalAddress())
continue;
addresses.add( addresses.add(
new TransportAddress(address, port, Transport.UDP)); new TransportAddress(address, port, Transport.UDP));