github-liyi commented on PR #6731:
URL: https://github.com/apache/incubator-nuttx/pull/6731#issuecomment-1198843722

   > ## 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 a IPv4 address only 
because the socket's domain is created in 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](http://www.baidu.com%EF%BC%88UDP) packet, DNS pkts) wget 
[http://www.baidu.com(TCP](http://www.baidu.com%EF%BC%88TCP) 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

Reply via email to