Skip to content

Conversation

@loganek
Copy link
Collaborator

@loganek loganek commented Sep 15, 2022

…ucture.

For some implementations (e.g. Mac OS) bind() requires the length to be exactly equal to either sockaddr_in or sockaddr_in6 structure. Because we always used sizeof(struct sockaddr_storage), bind() was returning errors. In this change we fix the behavior. See StackOverflow [1] for details.

[1] https://stackoverflow.com/questions/73707162/socket-bind-failed-with-invalid-argument-error-for-program-running-on-macos

…ucture.

For some implementations (e.g. Mac OS) `bind()` requires the length to be
exactly equal to either `sockaddr_in` or `sockaddr_in6` structure. Because
we always used `sizeof(struct sockaddr_storage)`, `bind()` was returning
errors. In this change we fix the behavior. See StackOverflow [1] for details.

[1] https://stackoverflow.com/questions/73707162/socket-bind-failed-with-invalid-argument-error-for-program-running-on-macos
@wenyongh wenyongh merged commit f967734 into bytecodealliance:dev/socket Sep 16, 2022
wenyongh added a commit that referenced this pull request Sep 22, 2022
Implement more socket APIs, refer to #1336 and below PRs:
- Implement wasi_addr_resolve function (#1319)
- Fix socket-api byte order issue when host/network order are the same (#1327)
- Enhance sock_addr_local syscall (#1320)
- Implement sock_addr_remote syscall (#1360)
- Add support for IPv6 in WAMR (#1411)
- Implement ns lookup allowlist (#1420)
- Implement sock_send_to and sock_recv_from system calls (#1457)
- Added http downloader and multicast socket options (#1467)
- Fix `bind()` calls to receive the correct size of `sockaddr` structure (#1490)
- Assert on correct parameters (#1505)
- Copy only received bytes from socket recv buffer into the app buffer (#1497)

Co-authored-by: Marcin Kolny <[email protected]>
Co-authored-by: Marcin Kolny <[email protected]>
Co-authored-by: Callum Macmillan <[email protected]>
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
bytecodealliance#1490)

For some implementations (e.g. Mac OS) `bind()` requires the length to be exactly
equal to either `sockaddr_in` or `sockaddr_in6` structure. Because we always used
 `sizeof(struct sockaddr_storage)`, `bind()` was returning errors. In this change we
 fix the behavior. See StackOverflow [1] for details.

[1] https://stackoverflow.com/questions/73707162/socket-bind-failed-with-invalid-argument-error-for-program-running-on-macos
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Implement more socket APIs, refer to bytecodealliance#1336 and below PRs:
- Implement wasi_addr_resolve function (bytecodealliance#1319)
- Fix socket-api byte order issue when host/network order are the same (bytecodealliance#1327)
- Enhance sock_addr_local syscall (bytecodealliance#1320)
- Implement sock_addr_remote syscall (bytecodealliance#1360)
- Add support for IPv6 in WAMR (bytecodealliance#1411)
- Implement ns lookup allowlist (bytecodealliance#1420)
- Implement sock_send_to and sock_recv_from system calls (bytecodealliance#1457)
- Added http downloader and multicast socket options (bytecodealliance#1467)
- Fix `bind()` calls to receive the correct size of `sockaddr` structure (bytecodealliance#1490)
- Assert on correct parameters (bytecodealliance#1505)
- Copy only received bytes from socket recv buffer into the app buffer (bytecodealliance#1497)

Co-authored-by: Marcin Kolny <[email protected]>
Co-authored-by: Marcin Kolny <[email protected]>
Co-authored-by: Callum Macmillan <[email protected]>
@loganek loganek deleted the loganek/fix-macos branch June 10, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants