[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426645109-3411-1-git-send-email-roopa@cumulusnetworks.com>
Date: Tue, 17 Mar 2015 19:18:28 -0700
From: roopa@...ulusnetworks.com
To: stephen@...workplumber.org
Cc: netdev@...r.kernel.org, vadim4j@...il.com
Subject: [PATCH iproute2] lib utils: fix family during af_bit_len calculation
From: Roopa Prabhu <roopa@...ulusnetworks.com>
commit f3a2ddc124e0 ("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@...net.de>
Signed-off-by: Roopa Prabhu <roopa@...ulusnetworks.com>
---
lib/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/utils.c b/lib/utils.c
index 9cda268..0d08a86 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -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)
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists