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 12:33:46 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request, #7014: net/netdev: correct return value of SIOCGIFFLAGS

anchao opened a new pull request, #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014

   
   ## Summary
   
   net/netdev: correct return value of SIOCGIFFLAGS
   
   Signed-off-by: chao an <an...@xiaomi.com>
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   netlib_getifstatus()


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
anchao commented on PR #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014#issuecomment-1238851483

   Close this PR let us track https://github.com/apache/incubator-nuttx/pull/7020


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


[GitHub] [incubator-nuttx] anchao commented on pull request #7014: net/netdev: correct return value of SIOCGIFFLAGS

Posted by GitBox <gi...@apache.org>.
anchao commented on PR #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014#issuecomment-1238138609

   > LGTM, but now this makes me wonder: Almost all of the other cases are returning `-EINVAL` rather than `-ENODEV` when `dev` is NULL. Is that correct?
   
   @hartmannathan This is incorrect, I will prepare a new PR to fix this issue


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


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

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014#discussion_r964329303


##########
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:
   Done



##########
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:
   Done



##########
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:
   Done



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


[GitHub] [incubator-nuttx] anchao closed pull request #7014: net/netdev: correct return value of SIOCGIFFLAGS/SIOCGIFCOUNT

Posted by GitBox <gi...@apache.org>.
anchao closed pull request #7014: net/netdev: correct return value of SIOCGIFFLAGS/SIOCGIFCOUNT
URL: https://github.com/apache/incubator-nuttx/pull/7014


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


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

Posted by GitBox <gi...@apache.org>.
hartmannathan commented on code in PR #7014:
URL: https://github.com/apache/incubator-nuttx/pull/7014#discussion_r964245960


##########
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:
   Then should probably be `-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