We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8a7dfa commit 9cc2e7aCopy full SHA for 9cc2e7a
include/enet.h
@@ -5655,8 +5655,15 @@ extern "C" {
5655
5656
if (address != NULL) {
5657
address->host = sin.sin6_addr;
5658
- address->port = ENET_NET_TO_HOST_16(sin.sin6_port);
5659
address->sin6_scope_id = sin.sin6_scope_id;
+ if (sin.sin6_family == AF_INET || (sin.sin6_family == AF_UNSPEC && sin.sin6_len == sizeof(struct sockaddr_in)))
5660
+ {
5661
+ enet_inaddr_map4to6(((struct sockaddr_in*)&sin)->sin_addr, &address->host);
5662
+ address->sin6_scope_id = 0;
5663
+ }
5664
+
5665
+ address->port = ENET_NET_TO_HOST_16(sin.sin6_port);
5666
5667
}
5668
5669
return recvLength;
0 commit comments