github-liyi opened a new pull request, #6735: URL: https://github.com/apache/incubator-nuttx/pull/6735
## Summary Add protection in the case when conn's domain isn't match with addr's family. When you create a IPv4 socket and connect to an IPv6 address, the original code logic will use the input IPv6 address as IPv4 address only because the socket's domain is initialized with AF_INET! This patch is to avoid this case, in which it refuses the connection and return EPROTOTYPE(error protocol type) ## Impact When you use nuttx's socket in a wrong way, it will refuse this wrong operation ## Testing Testing cases has been done with nuttx sim program for example ping www.baidu.com (UDP packet, DNS pkts) wget http://www.baidu.com (TCP packet, HTTP pkts) -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org