xiaoxiang781216 commented on code in PR #7083: URL: https://github.com/apache/incubator-nuttx/pull/7083#discussion_r972066779
########## 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: If so, usrsock isn't transparent as before, no application expect call setsockopt with different argument but for the same thing. What I suggest is that you should forward the ioctl to the default handle if usrsock driver return some special error code(e.g. -ENOPROTOOPT), so the usrsock driver can enable the default action in some special case. -- 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