Commit 106ca277 authored by Roopa Prabhu's avatar Roopa Prabhu Committed by Stephen Hemminger

lib utils: fix family during af_bit_len calculation

commit f3a2ddc1 ("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: default avatarSven-Haegar Koch <haegar@sdinet.de>
Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
parent 6f4cad91
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment