xiaoxiang781216 commented on a change in pull request #370: net: socket: Introduce net_clear_sinzero() URL: https://github.com/apache/incubator-nuttx/pull/370#discussion_r383618044
########## 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: It doesn't make sense to just clear IPv4 address, we should clear all unused field to zero for all address family, otherwise the similiar error will report again and again. ---------------------------------------------------------------- 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
