mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Use IPv6 for key agreement if IPv4 isn't available.
This commit is contained in:
@@ -329,7 +329,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public KeyAgreementListener createKeyAgreementListener(byte[] commitment) {
|
public KeyAgreementListener createKeyAgreementListener(byte[] commitment) {
|
||||||
ServerSocket ss = null;
|
ServerSocket ss = null;
|
||||||
for (InetSocketAddress addr : getLocalSocketAddresses(true)) {
|
for (InetSocketAddress addr : getLocalSocketAddresses()) {
|
||||||
// Don't try to reuse the same port we use for contact connections
|
// Don't try to reuse the same port we use for contact connections
|
||||||
addr = new InetSocketAddress(addr.getAddress(), 0);
|
addr = new InetSocketAddress(addr.getAddress(), 0);
|
||||||
try {
|
try {
|
||||||
@@ -355,6 +355,13 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
return new LanKeyAgreementListener(descriptor, ss);
|
return new LanKeyAgreementListener(descriptor, ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<InetSocketAddress> getLocalSocketAddresses() {
|
||||||
|
List<InetSocketAddress> addrs = new ArrayList<>();
|
||||||
|
addrs.addAll(getLocalSocketAddresses(true));
|
||||||
|
addrs.addAll(getLocalSocketAddresses(false));
|
||||||
|
return addrs;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DuplexTransportConnection createKeyAgreementConnection(
|
public DuplexTransportConnection createKeyAgreementConnection(
|
||||||
byte[] commitment, BdfList descriptor) {
|
byte[] commitment, BdfList descriptor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user