masayuki2009 commented on a change in pull request #370: net: socket: Introduce net_clear_sinzero() URL: https://github.com/apache/incubator-nuttx/pull/370#discussion_r383633427
########## File path: include/nuttx/net/net.h ########## @@ -478,6 +478,26 @@ FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid); int net_checksd(int fd, int oflags); +/**************************************************************************** + * Name: net_clear_sinzero() + * + * Description: + * In IPv4, sin_zero field exists in sockaddr_in for padding and should + * be set to zero. + * + * Input Parameters: + * from - Address of source (may be NULL) + * fromlen - The length of the address structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 Review comment: @xiaoxiang781216 In my understanding, padding field only exists in sockaddr_in (i.e. IPv4 family). So that's why I added ifdef CONFIG_NET_IPv4. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
