summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2019-09-13 19:21:16 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2019-12-09 09:47:41 -0600
commitfb8977c5be93f8e967df224fe0a44721d60e34dc (patch)
tree49a2f694f9ba5eee2302570311ec21b00bb659aa /cmd
parentb38c3a641fc01fcd4eda5fa107ae3c247baa0196 (diff)
net: Always build the string_to_enetaddr() helper
Part of the env cleanup moved this out of the environment code and into the net code. However, this helper is sometimes needed even when the net stack isn't included. Move the helper to lib/net_utils.c like it's similarly-purposed string_to_ip(). Also rename the moved function to similar naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Ondrej Jirman <megous@megous.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethsw.c2
-rw-r--r--cmd/nvedit.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/cmd/ethsw.c b/cmd/ethsw.c
index 8846805799..8d271ce1f3 100644
--- a/cmd/ethsw.c
+++ b/cmd/ethsw.c
@@ -864,7 +864,7 @@ static int keyword_match_mac_addr(enum ethsw_keyword_id key_id, int argc,
return 0;
}
- eth_parse_enetaddr(argv[*argc_nr + 1], parsed_cmd->ethaddr);
+ string_to_enetaddr(argv[*argc_nr + 1], parsed_cmd->ethaddr);
if (is_broadcast_ethaddr(parsed_cmd->ethaddr)) {
memset(parsed_cmd->ethaddr, 0xFF, sizeof(parsed_cmd->ethaddr));
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 3420e0b985..81d94cd193 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -361,7 +361,7 @@ ulong env_get_hex(const char *varname, ulong default_val)
int eth_env_get_enetaddr(const char *name, uint8_t *enetaddr)
{
- eth_parse_enetaddr(env_get(name), enetaddr);
+ string_to_enetaddr(env_get(name), enetaddr);
return is_valid_ethaddr(enetaddr);
}