net: be more restrictive with ethernet address format
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 18 Jul 2019 18:35:44 +0000 (11:35 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
commitd036e6a149b7210c911521e14833dac76bbca035
tree61f5b71926122a10b8bc9eb1f280d08b4b5fbd0f
parent9efa8d28b4daccda08ec0a2b8e45350fe089065f
net: be more restrictive with ethernet address format

The current ether_unformat_addr code was based off of
BSD ether_aton. That version changed what was allowed
by the cmdline ether address parser.
For example, it allows dropping leading zeros.

Change the code to be more restrictive and only allow the fully
expanded standard formats.

Bugzilla ID: 324
Fixes: 596d31092d32 ("net: add function to convert string to ethernet address")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_net/rte_ether.c
lib/librte_net/rte_ether.h