Simplify last change to netdev_findbyaddr
This commit is contained in:
parent
0478a97eca
commit
1c258c1c02
@ -96,20 +96,15 @@
|
|||||||
static FAR struct uip_driver_s *netdev_finddevice(const uip_ipaddr_t addr)
|
static FAR struct uip_driver_s *netdev_finddevice(const uip_ipaddr_t addr)
|
||||||
{
|
{
|
||||||
struct uip_driver_s *dev;
|
struct uip_driver_s *dev;
|
||||||
uint8_t iff;
|
|
||||||
|
|
||||||
/* Examine each registered network device */
|
/* Examine each registered network device */
|
||||||
|
|
||||||
netdev_semtake();
|
netdev_semtake();
|
||||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||||
{
|
|
||||||
/* Get the interface flags */
|
|
||||||
|
|
||||||
if (uip_getifstatus(dev->d_ifname, &iff) == OK)
|
|
||||||
{
|
{
|
||||||
/* Is the interface in the "up" state? */
|
/* Is the interface in the "up" state? */
|
||||||
|
|
||||||
if ((iff & IFF_UP) != 0)
|
if ((dev->d_flags & IFF_UP) != 0)
|
||||||
{
|
{
|
||||||
/* Yes.. check for an address match (under the netmask) */
|
/* Yes.. check for an address match (under the netmask) */
|
||||||
|
|
||||||
@ -122,7 +117,6 @@ static FAR struct uip_driver_s *netdev_finddevice(const uip_ipaddr_t addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* No device with the matching address found */
|
/* No device with the matching address found */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user