mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Don't bind to IPv6 addresses for mDNS
This commit is contained in:
parent
ed1a56dc68
commit
f282e84174
@ -3,6 +3,7 @@ package com.limelight.nvstream.mdns;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.NetworkInterface;
|
import java.net.NetworkInterface;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -84,8 +85,9 @@ public class MdnsDiscoveryAgent implements ServiceListener {
|
|||||||
public static class MyNetworkTopologyDiscovery extends NetworkTopologyDiscoveryImpl {
|
public static class MyNetworkTopologyDiscovery extends NetworkTopologyDiscoveryImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress) {
|
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.
|
// 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 {
|
try {
|
||||||
if (!networkInterface.isUp()) {
|
if (!networkInterface.isUp()) {
|
||||||
return false;
|
return false;
|
||||||
@ -97,6 +99,10 @@ public class MdnsDiscoveryAgent implements ServiceListener {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (interfaceAddress instanceof Inet6Address) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (networkInterface.isLoopback()) {
|
if (networkInterface.isLoopback()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user