mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
net: Remove IFF_DOWN flag to compatible with Linux/*BSD
turn off interface by checking IFF_UP flag isn't set: https://github.com/apache/nuttx/issues/1838 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
58e5bc7e74
commit
9b8a02749f
4 changed files with 3 additions and 10 deletions
|
|
@ -60,7 +60,7 @@ void alt1250_netdev_unregister(FAR struct alt1250_s *dev)
|
|||
|
||||
void alt1250_netdev_ifdown(FAR struct alt1250_s *dev)
|
||||
{
|
||||
dev->net_dev.d_flags = IFF_DOWN;
|
||||
dev->net_dev.d_flags = ~IFF_UP;
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
memset(&dev->net_dev.d_ipaddr, 0, sizeof(dev->net_dev.d_ipaddr));
|
||||
memset(&dev->net_dev.d_draddr, 0, sizeof(dev->net_dev.d_draddr));
|
||||
|
|
|
|||
|
|
@ -399,14 +399,9 @@ int usockreq_ioctl_ifreq(FAR struct alt1250_s *dev,
|
|||
{
|
||||
ret = do_ifup(dev, req, usock_result, usock_xid, ackinfo);
|
||||
}
|
||||
else if (if_req->ifr_flags & IFF_DOWN)
|
||||
{
|
||||
ret = do_ifdown(dev, req, usock_result, usock_xid, ackinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_alt1250("unexpected ifr_flags:0x%02x\n", if_req->ifr_flags);
|
||||
*usock_result = -EINVAL;
|
||||
ret = do_ifdown(dev, req, usock_result, usock_xid, ackinfo);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue