You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
posix os_socket_addr_resolve: relax compatibility check
yamt commentedon Jul 9, 2025
standard-wise, i couldn't find anything about ai_protocol in susv4-2018 except the following text:
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.
posix os_socket_addr_resolve: relax compatibility check
posix os_socket_addr_resolve: relax compatibility check (#4469)
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo
libs/libc/netdb: default ai_protocol and multi-transport in getaddrinfo