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 <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-03-01 16:13:22 +08:00 committed by Xiang Xiao
parent d59a9ea189
commit 76fde07d1c

View file

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