lib utils: fix family during af_bit_len calculation
commit f3a2ddc124 ("lib utils: Use helpers to get AF bit/byte len")
used a wrong family or family of zero in the default case
during af_bit_len calculation causing ip route commands to
fail with below error
Error: an inet prefix is expected rather than "10.0.2.14/24".
Reported-by: Sven-Haegar Koch <haegar@sdinet.de>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
parent
6f4cad9120
commit
106ca2779e
|
|
@ -477,7 +477,7 @@ int get_prefix_1(inet_prefix *dst, char *arg, int family)
|
|||
|
||||
err = get_addr_1(dst, arg, family);
|
||||
if (err == 0) {
|
||||
dst->bitlen = af_bit_len(family);
|
||||
dst->bitlen = af_bit_len(dst->family);
|
||||
|
||||
if (slash) {
|
||||
if (get_netmask(&plen, slash+1, 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue