Skip to content

Commit

Permalink
netdev: remove ASSERT when ifindex is invalid
Browse files Browse the repository at this point in the history
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 <zhanghongyu@xiaomi.com>
  • Loading branch information
zhhyu7 authored and xiaoxiang781216 committed Jun 13, 2023
1 parent d59a9ea commit 76fde07
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/netdev/netdev_findbyindex.c
Expand Up @@ -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;
Expand Down

0 comments on commit 76fde07

Please sign in to comment.