summaryrefslogtreecommitdiff
path: root/cmd/bdinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/bdinfo.c')
-rw-r--r--cmd/bdinfo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index ae9e1923eac..20c8c97f0cd 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -46,6 +46,7 @@ void bdinfo_print_num_ll(const char *name, unsigned long long value)
static void print_eth(void)
{
const int idx = eth_get_dev_index();
+ char ipstr[] = "ipaddr\0\0";
uchar enetaddr[6];
char name[10];
int ret;
@@ -62,7 +63,11 @@ static void print_eth(void)
printf("%-12s= (not set)\n", name);
else
printf("%-12s= %pM\n", name, enetaddr);
- printf("IP addr = %s\n", env_get("ipaddr"));
+
+ if (idx > 0)
+ sprintf(ipstr, "ipaddr%d", idx);
+
+ printf("IP addr = %s\n", env_get(ipstr));
}
void bdinfo_print_mhz(const char *name, unsigned long hz)