summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-01-17 10:49:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-01-20 08:38:22 +0100
commitc5b9aedd73199d4967c80b0aa3f2f7817260043f (patch)
treefdeca2b8fda15062d0ff16eb3149a29364d1a2ac /net
parent7124c4d68336f213e48a8e3f58a10980fb772b3b (diff)
downloadbarebox-c5b9aedd73199d4967c80b0aa3f2f7817260043f.tar.gz
net: eth: skip opening disabled interfaces when going interactive
Ethernet device global mode (ethX.mode) may be set to disabled when ports should not be used. This setting is already respect in ifup, so do likewise for eth_open_all(), which is called when going interactive. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230117094934.3770899-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/eth.c b/net/eth.c
index 863d0a0466..6fb64afea0 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -535,8 +535,11 @@ void eth_open_all(void)
{
struct eth_device *edev;
- list_for_each_entry(edev, &netdev_list, list)
+ list_for_each_entry(edev, &netdev_list, list) {
+ if (edev->global_mode == ETH_MODE_DISABLED)
+ continue;
eth_open(edev);
+ }
}
static int of_populate_ethaddr(void)