Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for issue #59 #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)))
Copy link
Member

@zpl-zak zpl-zak Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linux worker has failed to compile the code since sin does not have sin6_len defined. (afaik the field is only present if SIN6_LEN is defined)

Some adjustments have to be made to account for this difference on Linux platforms, whilst keeping the logic intact.

https://github.com/zpl-c/enet/actions/runs/12627791563/job/35194617740?pr=60#step:4:9

{
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
Loading