mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
netdev:When running, proto stack can exchange packets with device
netdev:when network device is running status,the network protocol stack is allowed to send packet to the network device and to receive from the network device Signed-off-by: wangchen <wangchen41@xiaomi.com>
This commit is contained in:
@@ -66,9 +66,9 @@ FAR struct net_driver_s *netdev_default(void)
|
||||
netdev_list_lock();
|
||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||
{
|
||||
/* Is the interface in the "up" state? */
|
||||
/* Is the interface in the "running" state? */
|
||||
|
||||
if ((dev->d_flags & IFF_UP) != 0)
|
||||
if (IFF_IS_RUNNING(dev->d_flags) != 0)
|
||||
{
|
||||
/* Return a reference to the first device that we find in the UP
|
||||
* state (but not the loopback device unless it is the only
|
||||
|
||||
@@ -83,9 +83,9 @@ netdev_prefixlen_findby_lipv4addr(in_addr_t lipaddr, FAR int8_t *prefixlen)
|
||||
netdev_list_lock();
|
||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||
{
|
||||
/* Is the interface in the "up" state? */
|
||||
/* Is the interface in the "running" state? */
|
||||
|
||||
if ((dev->d_flags & IFF_UP) != 0 &&
|
||||
if (IFF_IS_RUNNING(dev->d_flags) != 0 &&
|
||||
!net_ipv4addr_cmp(dev->d_ipaddr, INADDR_ANY))
|
||||
{
|
||||
#ifndef CONFIG_ROUTE_LONGEST_MATCH
|
||||
@@ -194,9 +194,9 @@ netdev_prefixlen_findby_lipv6addr(const net_ipv6addr_t lipaddr,
|
||||
|
||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||
{
|
||||
/* Is the interface in the "up" state? */
|
||||
/* Is the interface in the "running" state? */
|
||||
|
||||
if ((dev->d_flags & IFF_UP) != 0 && NETDEV_HAS_V6ADDR(dev))
|
||||
if (IFF_IS_RUNNING(dev->d_flags) != 0 && NETDEV_HAS_V6ADDR(dev))
|
||||
{
|
||||
#ifndef CONFIG_ROUTE_LONGEST_MATCH
|
||||
/* Yes.. check for an address match (under the netmask) */
|
||||
|
||||
Reference in New Issue
Block a user