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

Fix xnetsocket recvfrom never populating the from_addr due to fromlen being zero #1107

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion generated/nixnetsocket/nixnetsocket_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ namespace nixnetsocket_grpc {

std::string data(size, '\0');
auto from_addr = allocate_output_storage<nxsockaddr, SockAddr>();
nxsocklen_t fromlen {};
auto fromlen = static_cast<nxsocklen_t>(sizeof(from_addr.storage));
auto status = library_->RecvFrom(socket, (char*)data.data(), size, flags, &from_addr, &fromlen);
if (!status_ok(status)) {
return ConvertApiErrorStatusForNxSOCKET(context, status, socket);
Expand Down
3 changes: 2 additions & 1 deletion source/codegen/metadata/nixnetsocket/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,8 @@
'direction': 'out',
'name': 'fromlen',
'include_in_proto': False,
'type': 'nxsocklen_t'
'type': 'nxsocklen_t',
'hardcoded_value': 'static_cast<nxsocklen_t>(sizeof(from_addr.storage))'
maxxboehme marked this conversation as resolved.
Show resolved Hide resolved
},
],
'returns': 'int32_t'
Expand Down