diff options
author | Roger Quadros <rogerq@ti.com> | 2017-03-13 15:04:33 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-03-20 17:57:16 -0400 |
commit | ee6fdfadaafeb50a2e7d2a5a4f978332b5198000 (patch) | |
tree | 5eca0c7ca6c0428ad8cddfdb6d62493726ba8ca0 | |
parent | 752a8311e9c13af807ff9a32fbb2491282a41c8a (diff) |
net: don't override ethernet address environment
If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r-- | net/eth_common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/eth_common.c b/net/eth_common.c index e9d3c66741..58fa295771 100644 --- a/net/eth_common.c +++ b/net/eth_common.c @@ -34,6 +34,9 @@ int eth_setenv_enetaddr(const char *name, const uchar *enetaddr) { char buf[ARP_HLEN_ASCII + 1]; + if (eth_getenv_enetaddr(name, (uchar *)buf)) + return -EEXIST; + sprintf(buf, "%pM", enetaddr); return setenv(name, buf); |