Swatantra-66 commented on PR #20691:
URL: https://github.com/apache/nuttx/pull/20691#issuecomment-6396875891

   > Should we have an apps PR that sets `AI_CANONNAME` and `SOCK_STREAM` in 
the hints of `cmd_nslookup()` ?
   
   Yes, That makes complete sense.
   Because #20691 expands unspecified ai_socktype == 0 into distinct 
SOCK_STREAM and SOCK_DGRAM records, cmd_nslookup() in nshlib/nsh_netcmds.c 
(which passes hints == NULL) iterates through both transports and prints 
duplicate IP entries, while also expecting next->ai_canonname (which should 
formally be requested via AI_CANONNAME).
   Setting hints.ai_flags = AI_CANONNAME; and hints.ai_socktype = SOCK_STREAM; 
in cmd_nslookup() will keep the output clean (single entry per resolved IP) and 
POSIX-compliant.
   
   I can open the companion nuttx-apps PR


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to