mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-16 07:16:35 +00:00
Yeah it helps to byte swap the port back to little-endian before sending the port off to Java
This commit is contained in:
parent
b242886c33
commit
02b33e3763
@ -364,13 +364,13 @@ jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
|
||||
case AF_INET6:
|
||||
{
|
||||
sockaddr_in6 *ipv6 = (sockaddr_in6*)&addr;
|
||||
port = ipv6->sin6_port;
|
||||
port = ntohs(ipv6->sin6_port);
|
||||
}
|
||||
break;
|
||||
case AF_INET:
|
||||
{
|
||||
sockaddr_in *ipv4 = (sockaddr_in*)&addr;
|
||||
port = ipv4->sin_port;
|
||||
port = ntohs(ipv4->sin_port);
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user