aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java
index bb7d31b..d29be03 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesHarvester.java
@@ -36,7 +36,7 @@ import org.xmpp.jnodes.smack.*;
* @author Sebastien Vincent
*/
public class JingleNodesHarvester
- extends CandidateHarvester
+ extends AbstractCandidateHarvester
{
/**
* The <tt>Logger</tt> used by the <tt>JingleNodesHarvester</tt> class and
@@ -125,7 +125,7 @@ public class JingleNodesHarvester
}
}
- if (ciq != null && ciq.getRemoteport() > 0)
+ if (ciq != null)
{
ip = ciq.getHost();
port = ciq.getRemoteport();
@@ -136,6 +136,22 @@ public class JingleNodesHarvester
" local port: " + ciq.getLocalport());
}
+ if (ip == null || ciq.getRemoteport() == 0)
+ {
+ logger.warn("JN relay ignored because ip was null or port 0");
+ return candidates;
+ }
+
+ // Drop the scope or interface name if the relay sends it
+ // along in its IPv6 address. The scope/ifname is only valid on the
+ // host that owns the IP and we don't need it here.
+ int scopeIndex = ip.indexOf('%');
+ if (scopeIndex > 0)
+ {
+ logger.warn("Dropping scope from assumed IPv6 address " + ip);
+ ip = ip.substring(0, scopeIndex);
+ }
+
/* RTP */
TransportAddress relayedAddress = new TransportAddress(ip, port,
Transport.UDP);
@@ -160,6 +176,7 @@ public class JingleNodesHarvester
candidates.add(local);
}
}
+
return candidates;
}