This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 76fde07d1c netdev: remove ASSERT when ifindex is invalid
76fde07d1c is described below

commit 76fde07d1c22fdc31285bf47c8755af445264b9f
Author: zhanghongyu <[email protected]>
AuthorDate: Wed Mar 1 16:13:22 2023 +0800

    netdev: remove ASSERT when ifindex is invalid
    
    There is no control over whether a valid index is input when user use
    ioctl to get netdev information, so removing this assertion will allow
    ENODEV to be returned.
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 net/netdev/netdev_findbyindex.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/netdev/netdev_findbyindex.c b/net/netdev/netdev_findbyindex.c
index afed76fee2..44a5571cdb 100644
--- a/net/netdev/netdev_findbyindex.c
+++ b/net/netdev/netdev_findbyindex.c
@@ -61,7 +61,6 @@ FAR struct net_driver_s *netdev_findbyindex(int ifindex)
    * POSIX to mean no interface index.
    */
 
-  DEBUGASSERT(ifindex > 0 && ifindex <= MAX_IFINDEX);
   if (ifindex < 1 || ifindex > MAX_IFINDEX)
     {
       return NULL;

Reply via email to