Merge branch 'master' into cast_away_multicast
This commit is contained in:
commit
bcd58ad02f
|
@ -24,7 +24,6 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.network.NetworkAddress;
|
import org.elasticsearch.common.network.NetworkAddress;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Inet6Address;
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
|
@ -41,12 +40,7 @@ public final class InetSocketTransportAddress implements TransportAddress {
|
||||||
final int len = in.readByte();
|
final int len = in.readByte();
|
||||||
final byte[] a = new byte[len]; // 4 bytes (IPv4) or 16 bytes (IPv6)
|
final byte[] a = new byte[len]; // 4 bytes (IPv4) or 16 bytes (IPv6)
|
||||||
in.readFully(a);
|
in.readFully(a);
|
||||||
InetAddress inetAddress;
|
InetAddress inetAddress = InetAddress.getByAddress(a);
|
||||||
if (len == 16) {
|
|
||||||
inetAddress = Inet6Address.getByAddress(null, a);
|
|
||||||
} else {
|
|
||||||
inetAddress = InetAddress.getByAddress(a);
|
|
||||||
}
|
|
||||||
int port = in.readInt();
|
int port = in.readInt();
|
||||||
this.address = new InetSocketAddress(inetAddress, port);
|
this.address = new InetSocketAddress(inetAddress, port);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue