mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Temporarily disabled IPv6 support.
Some devices don't support IPv6, so we'll need to bind separate IPv4 and IPv6 sockets and advertise both addresses.
This commit is contained in:
@@ -5,6 +5,7 @@ import static java.util.logging.Level.WARNING;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.MulticastSocket;
|
import java.net.MulticastSocket;
|
||||||
@@ -91,6 +92,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
for(NetworkInterface iface : ifaces) {
|
for(NetworkInterface iface : ifaces) {
|
||||||
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
||||||
if(addr != null && a.equals(addr)) continue;
|
if(addr != null && a.equals(addr)) continue;
|
||||||
|
if(a instanceof Inet6Address) continue;
|
||||||
if(a.isLoopbackAddress()) continue;
|
if(a.isLoopbackAddress()) continue;
|
||||||
boolean link = a.isLinkLocalAddress();
|
boolean link = a.isLinkLocalAddress();
|
||||||
boolean site = a.isSiteLocalAddress();
|
boolean site = a.isSiteLocalAddress();
|
||||||
@@ -101,6 +103,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
for(NetworkInterface iface : ifaces) {
|
for(NetworkInterface iface : ifaces) {
|
||||||
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
||||||
if(addr != null && a.equals(addr)) continue;
|
if(addr != null && a.equals(addr)) continue;
|
||||||
|
if(a instanceof Inet6Address) continue;
|
||||||
if(a.isLoopbackAddress()) continue;
|
if(a.isLoopbackAddress()) continue;
|
||||||
boolean link = a.isLinkLocalAddress();
|
boolean link = a.isLinkLocalAddress();
|
||||||
boolean site = a.isSiteLocalAddress();
|
boolean site = a.isSiteLocalAddress();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.sf.briar.plugins.tcp;
|
|||||||
|
|
||||||
import static java.util.logging.Level.WARNING;
|
import static java.util.logging.Level.WARNING;
|
||||||
|
|
||||||
|
import java.net.Inet6Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.NetworkInterface;
|
import java.net.NetworkInterface;
|
||||||
@@ -84,6 +85,7 @@ class WanTcpPlugin extends TcpPlugin {
|
|||||||
for(NetworkInterface iface : ifaces) {
|
for(NetworkInterface iface : ifaces) {
|
||||||
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
for(InetAddress a : Collections.list(iface.getInetAddresses())) {
|
||||||
if(addr != null && a.equals(addr)) continue;
|
if(addr != null && a.equals(addr)) continue;
|
||||||
|
if(a instanceof Inet6Address) continue;
|
||||||
if(a.isLoopbackAddress()) continue;
|
if(a.isLoopbackAddress()) continue;
|
||||||
boolean link = a.isLinkLocalAddress();
|
boolean link = a.isLinkLocalAddress();
|
||||||
boolean site = a.isSiteLocalAddress();
|
boolean site = a.isSiteLocalAddress();
|
||||||
@@ -93,8 +95,10 @@ class WanTcpPlugin extends TcpPlugin {
|
|||||||
// Accept interfaces with local addresses that can be port-mapped
|
// Accept interfaces with local addresses that can be port-mapped
|
||||||
if(port == 0) port = chooseEphemeralPort();
|
if(port == 0) port = chooseEphemeralPort();
|
||||||
mappingResult = portMapper.map(port);
|
mappingResult = portMapper.map(port);
|
||||||
if(mappingResult != null && mappingResult.isUsable())
|
if(mappingResult != null && mappingResult.isUsable()) {
|
||||||
addrs.add(mappingResult.getInternal());
|
InetSocketAddress a = mappingResult.getInternal();
|
||||||
|
if(!(a.getAddress() instanceof Inet6Address)) addrs.add(a);
|
||||||
|
}
|
||||||
return addrs;
|
return addrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user