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/12/05 09:57:21 UTC

[GitHub] [incubator-nuttx] anchao commented on a change in pull request #2415: net/igmp: add MULTICAST_TTL support

anchao commented on a change in pull request #2415:
URL: https://github.com/apache/incubator-nuttx/pull/2415#discussion_r536635561



##########
File path: net/inet/ipv4_setsockopt.c
##########
@@ -184,16 +189,41 @@ int ipv4_setsockopt(FAR struct socket *psock, int option,
         }
         break;
 
-      /* The following IPv4 socket options are defined, but not implemented */
-
-      case IP_MULTICAST_IF:           /* Set local device for a multicast
-                                       * socket */
       case IP_MULTICAST_TTL:          /* Set/read the time-to-live value of
                                        * outgoing multicast packets */
+        {
+          if (psock->s_type != SOCK_DGRAM ||
+              value_len != sizeof(int))

Review comment:
       Hi @btashton 
   
   You are right. I just checked the linux source code and found that they have added processing of different data types.
   
   https://github.com/torvalds/linux/blob/b3298500b23f0b53a8d81e0d5ad98a29db71f4f0/net/ipv4/ip_sockglue.c#L923-L932
   
   I made a new change according to this part, please review it again, thank you!




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