public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib utils: use a correct variable to get address length
@ 2015-03-23 21:16 Andrew Vagin
  2015-03-23 21:53 ` roopa
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Vagin @ 2015-03-23 21:16 UTC (permalink / raw)
  To: Stephen Hemminger, netdev; +Cc: Andrew Vagin, Vadim Kochan

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@gmail.com>
Fixes: f3a2ddc124e0 ("lib utils: Use helpers to get AF bit/byte len")
Signed-off-by: Andrew Vagin <avagin@openvz.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib utils: use a correct variable to get address length
  2015-03-23 21:16 [PATCH] lib utils: use a correct variable to get address length Andrew Vagin
@ 2015-03-23 21:53 ` roopa
  0 siblings, 0 replies; 2+ messages in thread
From: roopa @ 2015-03-23 21:53 UTC (permalink / raw)
  To: Andrew Vagin; +Cc: Stephen Hemminger, netdev, Vadim Kochan, Sven-Haegar Koch

On 3/23/15, 2:16 PM, Andrew Vagin wrote:
> 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@gmail.com>
> Fixes: f3a2ddc124e0 ("lib utils: Use helpers to get AF bit/byte len")
> Signed-off-by: Andrew Vagin <avagin@openvz.org>

I have already submitted similar patch 
https://patchwork.ozlabs.org/patch/451210/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-23 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 21:16 [PATCH] lib utils: use a correct variable to get address length Andrew Vagin
2015-03-23 21:53 ` roopa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox