diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c index 1a175c45973..f0a3996cd61 100644 --- a/net/net.c +++ b/net/net.c @@ -1614,3 +1614,15 @@ ushort env_get_vlan(char *var) { return string_to_vlan(env_get(var)); } + +void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr) +{ + char *end; + int i; + + for (i = 0; i < 6; ++i) { + enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0; + if (addr) + addr = (*end) ? end + 1 : end; + } +} |