This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/releases/12.7 by this push:
new 002d89885e net: Remove IFF_DOWN flag to compatible with Linux/*BSD
002d89885e is described below
commit 002d89885e9a1580164cf1f7d1627287b3d1cc11
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Oct 6 15:15:56 2024 +0800
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 <[email protected]>
---
boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c | 2 +-
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 3 +--
include/net/if.h | 1 -
net/netdev/netdev_ioctl.c | 5 +----
4 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c
b/boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c
index cacae04e88..f9f7339ed2 100644
--- a/boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c
+++ b/boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c
@@ -316,7 +316,7 @@ int s32k3xx_tja1153_initialize(int bus)
/* Bring down the interface */
- ifr.ifr_flags = IFF_DOWN;
+ ifr.ifr_flags = 0;
ret = ioctl(sock, SIOCSIFFLAGS, (unsigned long)&ifr);
if (ret < 0)
{
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c
b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c
index 71e1fea2e7..3583f980eb 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c
@@ -921,8 +921,7 @@ static int bcmf_ioctl(FAR struct net_driver_s *dev, int cmd,
if (!priv->bc_bifup)
{
- wlerr("ERROR: invalid state "
- "(IFF_DOWN, unable to execute command: %x)\n", cmd);
+ wlerr("ERROR: invalid state (unable to execute command: %x)\n", cmd);
return -EPERM;
}
diff --git a/include/net/if.h b/include/net/if.h
index 5a604ad979..78a7661ef6 100644
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -46,7 +46,6 @@
/* Interface flag bits */
-#define IFF_DOWN (1 << 0) /* Interface is down */
#define IFF_UP (1 << 1) /* Interface is up */
#define IFF_RUNNING (1 << 2) /* Carrier is available */
#define IFF_IPv6 (1 << 3) /* Configured for IPv6 packet (vs ARP or
IPv4) */
diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c
index 0aaa79badd..461eef8513 100644
--- a/net/netdev/netdev_ioctl.c
+++ b/net/netdev/netdev_ioctl.c
@@ -990,10 +990,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int
cmd,
arp_acd_setup(dev);
#endif /* CONFIG_NET_ARP_ACD */
}
-
- /* Is this a request to take the interface down? */
-
- else if ((req->ifr_flags & IFF_DOWN) != 0)
+ else
{
/* Yes.. take the interface down */