Patchwork Fix error decoding router advertisements netlink messages

login
register
mail settings
Submitter Andreas Henriksson
Date July 20, 2011, 8:41 a.m.
Message ID <1311151281-25479-1-git-send-email-andreas@fatal.se>
Download mbox | patch
Permalink /patch/105601/
State Accepted
Delegated to: stephen hemminger
Headers show

Comments

Andreas Henriksson - July 20, 2011, 8:41 a.m.
From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>

The "ip monitor" command does properly decode the "preferred" and
"valid" lifetime records in router advertisements from netlink
messages.

For more details see http://bugs.debian.org/634170

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
---
 ip/ipprefix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
stephen hemminger - July 20, 2011, 11:04 p.m.
On Wed, 20 Jul 2011 10:41:21 +0200
Andreas Henriksson <andreas@fatal.se> wrote:

> From: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
> 
> The "ip monitor" command does properly decode the "preferred" and
> "valid" lifetime records in router advertisements from netlink
> messages.
> 
> For more details see http://bugs.debian.org/634170
> 
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>

Applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/ip/ipprefix.c b/ip/ipprefix.c
index cb1f582..d8327be 100644
--- a/ip/ipprefix.c
+++ b/ip/ipprefix.c
@@ -92,7 +92,7 @@  int print_prefix(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
 	if (tb[PREFIX_CACHEINFO]) {
 		struct prefix_cacheinfo *pc;
-		pc = (struct prefix_cacheinfo *)tb[PREFIX_CACHEINFO];
+		pc = (struct prefix_cacheinfo *)RTA_DATA(tb[PREFIX_CACHEINFO]);
 
 		fprintf(fp, "valid %u ", pc->valid_time);
 		fprintf(fp, "preferred %u ", pc->preferred_time);