You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "yamt (via GitHub)" <gi...@apache.org> on 2025/07/08 11:24:19 UTC
[I] [BUG] getaddrinfo doesn't fill ai_protocol [nuttx]
yamt opened a new issue, #16693:
URL: https://github.com/apache/nuttx/issues/16693
### Description / Steps to reproduce the issue
consider using getaddrinfo with
hints.ai_family == AF_INET
hints.ai_socktype == SOCK_STREAM
hints.ai_protocol == 0
i expect the result contains ai_protocol == IPPROTO_TCP.
but nuttx seems to leave it to 0.
standard-wise, the nuttx behavior might or might be allowed. (i haven't checked.)
anyway, i guess it's better to follow the de-fact behavior (kame etc) for compatibility for applications.
for example, wamr seems to have [the assumption](https://github.com/bytecodealliance/wasm-micro-runtime/blob/d3b0b5c066e21ba3568448ad42e0b920e67d16ba/core/shared/platform/common/posix/posix_socket.c#L376-L377).
### On which OS does this issue occur?
[OS: Mac]
### What is the version of your OS?
macOS 15.5
### NuttX Version
master
### Issue Architecture
[Arch: simulator]
### Issue Area
[Area: Networking]
### Host information
_No response_
### Verification
- [x] I have verified before submitting the report.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] getaddrinfo doesn't fill ai_protocol [nuttx]
Posted by "yamt (via GitHub)" <gi...@apache.org>.
yamt commented on issue #16693:
URL: https://github.com/apache/nuttx/issues/16693#issuecomment-3050960755
> standard-wise, the nuttx behavior might or might be allowed. (i haven't checked.)
standard-wise, i couldn't find anything about ai_protocol in susv4-2018 except the following text:
The fields ai_family, ai_socktype, and ai_protocol shall be usable
as the arguments to the socket() function to create a socket suitable
for use with the returned address.
because ai_protocol is usually merely used to feed socket() and socket() usually accepts 0, it's probably standard-wise ok for getaddrinfo to return ai_protocol=0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] getaddrinfo doesn't fill ai_protocol [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 closed issue #16693: [BUG] getaddrinfo doesn't fill ai_protocol
URL: https://github.com/apache/nuttx/issues/16693
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org