diff --git a/src/org/ice4j/ice/harvest/SinglePortUdpHarvester.java b/src/org/ice4j/ice/harvest/SinglePortUdpHarvester.java index b9bfce3..8e7d19e 100644 --- a/src/org/ice4j/ice/harvest/SinglePortUdpHarvester.java +++ b/src/org/ice4j/ice/harvest/SinglePortUdpHarvester.java @@ -77,10 +77,12 @@ public class SinglePortUdpHarvester = new LinkedList(); List addresses = new LinkedList(); - boolean isIPv6Disabled = StackProperties.getBoolean( StackProperties.DISABLE_IPv6, false); + boolean isIPv6LinkLocalDisabled = StackProperties.getBoolean( + StackProperties.DISABLE_LINK_LOCAL_ADDRESSES, + false); try { @@ -100,8 +102,15 @@ public class SinglePortUdpHarvester { InetAddress address = ifaceAddresses.nextElement(); + if (!HostCandidateHarvester.isAddressAllowed(address)) + continue; + if (isIPv6Disabled && address instanceof Inet6Address) continue; + if (isIPv6LinkLocalDisabled + && address instanceof Inet6Address + && address.isLinkLocalAddress()) + continue; addresses.add( new TransportAddress(address, port, Transport.UDP));