From f282e8417444ecd765a0f93bbd95419247c6af42 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 6 Jun 2017 22:34:15 -0700 Subject: [PATCH] Don't bind to IPv6 addresses for mDNS --- .../com/limelight/nvstream/mdns/MdnsDiscoveryAgent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moonlight-common/src/main/java/com/limelight/nvstream/mdns/MdnsDiscoveryAgent.java b/moonlight-common/src/main/java/com/limelight/nvstream/mdns/MdnsDiscoveryAgent.java index 8fe3e816..fd997773 100644 --- a/moonlight-common/src/main/java/com/limelight/nvstream/mdns/MdnsDiscoveryAgent.java +++ b/moonlight-common/src/main/java/com/limelight/nvstream/mdns/MdnsDiscoveryAgent.java @@ -3,6 +3,7 @@ package com.limelight.nvstream.mdns; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.Inet4Address; +import java.net.Inet6Address; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.ArrayList; @@ -84,8 +85,9 @@ public class MdnsDiscoveryAgent implements ServiceListener { public static class MyNetworkTopologyDiscovery extends NetworkTopologyDiscoveryImpl { @Override public boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress) { - // This is an exact copy of jmDNS's implementation, except we omit the multicast check, since + // This is an copy of jmDNS's implementation, except we omit the multicast check, since // it seems at least some devices lie about interfaces not supporting multicast when they really do. + // We also will skip IPv6 addresses since GeForce Experience doesn't listen on IPv6 ports. try { if (!networkInterface.isUp()) { return false; @@ -97,6 +99,10 @@ public class MdnsDiscoveryAgent implements ServiceListener { } */ + if (interfaceAddress instanceof Inet6Address) { + return false; + } + if (networkInterface.isLoopback()) { return false; }