lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427145369-29477-1-git-send-email-avagin@openvz.org>
Date:	Tue, 24 Mar 2015 00:16:09 +0300
From:	Andrew Vagin <avagin@...nvz.org>
To:	Stephen Hemminger <shemminger@...l.org>, netdev@...r.kernel.org
Cc:	Andrew Vagin <avagin@...nvz.org>, Vadim Kochan <vadim4j@...il.com>
Subject: [PATCH] lib utils: use a correct variable to get address length

dst->famaly is initialized in get_addr_1()

This patch fixes errors like this:
$ ip r a 10.31.0.0/16 dev br0
Error: an inet prefix is expected rather than "10.31.0.0/16".

Cc: Vadim Kochan <vadim4j@...il.com>
Fixes: f3a2ddc124e0 ("lib utils: Use helpers to get AF bit/byte len")
Signed-off-by: Andrew Vagin <avagin@...nvz.org>
---
 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)
-- 
2.1.0

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ