mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02: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
1 changed files with 2 additions and 2 deletions
|
@ -364,13 +364,13 @@ jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
{
|
{
|
||||||
sockaddr_in6 *ipv6 = (sockaddr_in6*)&addr;
|
sockaddr_in6 *ipv6 = (sockaddr_in6*)&addr;
|
||||||
port = ipv6->sin6_port;
|
port = ntohs(ipv6->sin6_port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
{
|
{
|
||||||
sockaddr_in *ipv4 = (sockaddr_in*)&addr;
|
sockaddr_in *ipv4 = (sockaddr_in*)&addr;
|
||||||
port = ipv4->sin_port;
|
port = ntohs(ipv4->sin_port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue