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/06 18:02:22 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7014: net/netdev: correct return value of SIOCGIFFLAGS/SIOCGIFCOUNT

xiaoxiang781216 commented on code in PR #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014#discussion_r964017175


##########
net/netdev/netdev_ioctl.c:
##########
@@ -992,6 +996,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
 #endif
                 {
                   nerr("Unsupported link layer\n");
+                  ret = -ENOSYS;

Review Comment:
   ditto



##########
net/netdev/netdev_ioctl.c:
##########
@@ -947,6 +950,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
 #endif
                 {
                   nerr("Unsupported link layer\n");
+                  ret = -ENOSYS;

Review Comment:
   why change the error code to -ENOSYS? ENOSYS mean OS doesn't support the functionality yet, it isn't good to indicate that netdev hasn't hardware address.



##########
net/netdev/netdev_ioctl.c:
##########
@@ -905,9 +905,12 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
           if (dev)
             {
               req->ifr_flags = dev->d_flags;
+              ret = OK;
+            }
+          else
+            {
+              ret = -ENODEV;

Review Comment:
   let's set ret = -ENODEV at line 640 and remove other places which set ret to -ENODEV



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