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 2022/09/13 10:45:10 UTC

[GitHub] [incubator-nuttx] vuhuyhop197 commented on a diff in pull request #7083: sockopt:Change the flow of function psock_setsockopt and psock_getsockopt

vuhuyhop197 commented on code in PR #7083:
URL: https://github.com/apache/incubator-nuttx/pull/7083#discussion_r969460910


##########
net/socket/getsockopt.c:
##########
@@ -337,50 +337,51 @@ int psock_getsockopt(FAR struct socket *psock, int level, int option,
       return -EBADF;
     }
 
-  /* Handle retrieval of the socket option according to the level at which
-   * option should be applied.
-   */
+#ifdef CONFIG_NET_USRSOCK
+  /* Try usrsock further if the protocol not available */
 
-  switch (level)
+  if (psock->s_type == SOCK_USRSOCK_TYPE)
     {
-      case SOL_SOCKET:   /* Socket-level options (see include/sys/socket.h) */
-       ret = psock_socketlevel_option(psock, option, value, value_len);
-       break;
+      ret = usrsock_getsockopt(psock->s_conn, level,
+                               option, value, value_len);
+    }
+  else

Review Comment:
   I think when we using the usrsock. The socket will need to redirect everything to the user's socket. and it will bypass nutxx default socket.



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org