masc2008 commented on code in PR #18247:
URL: https://github.com/apache/nuttx/pull/18247#discussion_r2749548768
##########
net/netdev/netdev_findbyaddr.c:
##########
@@ -393,7 +401,15 @@ FAR struct net_driver_s *netdev_findby_ripv4addr(in_addr_t
lipaddr,
* try the default network device.
*/
- return netdev_default();
+ dev = netdev_default();
+ if (dev && net_ipv4addr_cmp(dev->d_ipaddr, INADDR_ANY))
Review Comment:
one net device can just have an ipv6 address, so it's not a good idea to the
check there. One reason for here, it's for ipv4 netdev_findbyaddr, if find by
addr, the device should have an legal ip address.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]