mirror of https://github.com/M66B/FairEmail.git
Fixed IPv6 local host address
This commit is contained in:
parent
a4ab65cc50
commit
645c843161
|
@ -270,8 +270,11 @@ public class ServiceSend extends LifecycleService {
|
|||
InetAddress addr = InetAddress.getByName(ident.host);
|
||||
if (addr instanceof Inet4Address)
|
||||
haddr = "[" + Inet4Address.getLocalHost().getHostAddress() + "]";
|
||||
else
|
||||
haddr = "[IPv6:" + Inet6Address.getLocalHost().getHostAddress() + "]";
|
||||
else {
|
||||
// Inet6Address.getLocalHost() will return the IPv6 local host
|
||||
byte[] LOOPBACK = new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
|
||||
haddr = "[IPv6:" + Inet6Address.getByAddress("ip6-localhost", LOOPBACK, 0).getHostAddress() + "]";
|
||||
}
|
||||
} else
|
||||
haddr = ident.host;
|
||||
|
||||
|
|
Loading…
Reference in New Issue