summaryrefslogtreecommitdiff
path: root/net/eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/eth.c')
-rw-r--r--net/eth.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c
index ec2ef1a365..217e8853f5 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -28,6 +28,9 @@
#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+static char *act = NULL;
+static int env_changed_id = 0;
+
/*
* CPU and board-specific Ethernet initializations. Aliased function
* signals caller to move on
@@ -461,13 +464,17 @@ void eth_try_another(int first_restart)
#ifdef CONFIG_NET_MULTI
void eth_set_current(void)
{
- char *act;
struct eth_device* old_current;
+ int env_id;
if (!eth_current) /* XXX no current */
return;
- act = getenv("ethact");
+ env_id = get_env_id();
+ if ((act == NULL) || (env_changed_id != env_id)) {
+ act = getenv("ethact");
+ env_changed_id = env_id;
+ }
if (act != NULL) {
old_current = eth_current;
do {