From 8d96b2938224bf314862c3b981209a363330ccc8 Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 2 Jun 2015 12:22:32 +0000 Subject: [PATCH] Fixes the address filtering for single-port UDP. --- src/org/ice4j/ice/harvest/SinglePortUdpHarvester.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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));