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/06/27 14:14:14 UTC

[GitHub] [incubator-nuttx] anchao commented on pull request #1291: socket/SOL: sync the SOL index with linux

anchao commented on pull request #1291:
URL: https://github.com/apache/incubator-nuttx/pull/1291#issuecomment-650566279


   > @anchao is there any benefit to be "sync" with linux?
   
   Unsynchronized options will cause some compatibility issues, 
   for example:
   
   `setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));`
   
   ```
   int psock_setsockopt(FAR struct socket *psock, int level, int option,
                        FAR const void *value, socklen_t value_len)
   ...
         case SOL_IP:    <-- 
           ret = ipv4_setsockopt(psock, option, value, value_len);
           break;
   ....
   ```
   
   this option configure will be failure since IPPROTO_IP and SOL_IP are different definitions in NuttX,
   if we want to be fully compatible with posix applications, the experience of adopting Linux will be a good choice.


----------------------------------------------------------------
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