Skip to content

Commit

Permalink
Proposed fix for issue zpl-c#59 in upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
kovewnikov committed Jan 6, 2025
1 parent e8a7dfa commit 9cc2e7a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -5655,8 +5655,15 @@ extern "C" {

if (address != NULL) {
address->host = sin.sin6_addr;
address->port = ENET_NET_TO_HOST_16(sin.sin6_port);
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)))
{
enet_inaddr_map4to6(((struct sockaddr_in*)&sin)->sin_addr, &address->host);
address->sin6_scope_id = 0;
}

address->port = ENET_NET_TO_HOST_16(sin.sin6_port);

}

return recvLength;
Expand Down

0 comments on commit 9cc2e7a

Please sign in to comment.