You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/25 13:36:21 UTC

[GitHub] [incubator-nuttx] patacongo edited a comment on issue #370: net: socket: Introduce net_clear_sinzero()

patacongo edited a comment on issue #370: net: socket: Introduce net_clear_sinzero()
URL: https://github.com/apache/incubator-nuttx/pull/370#issuecomment-590869227
 
 
   > does it make sense that we call memset on the whole addr before call si_getpeername/si_getsockename/si_accept/si_recvfrom?
   
   I dislike that solution too.  It is a ugly hack.  We should do it right.  sin_zerio is not different then any other field in sockadd_in.  The clean, easily unstandable way is:
   
       addr->sin_port = AF_INET;
       addr->sin_addr.s_addr = addr;
       memset(addr->sin_zero, 0, sizeof(addr->sin_zero));
   
   Let's not take ugly shortcuts.
   
   But having said that, it is not as ugly as the original proposal.  It is just not as straightforward.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services