From 07a760494b861a9c99ead1f62c0c984f38e19f2b Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 20 Dec 2017 12:22:46 +0100 Subject: [PATCH] gluon-radv-filterd: Fix byte order of nd_ra_router_lifetime The ICMPv6 packet is stored in network byte order. It must therefore always be converted to host byteorder before it can be used in calculations. Signed-off-by: Sven Eckelmann --- package/gluon-radv-filterd/src/gluon-radv-filterd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c index 77a0f4ce..fde27091 100644 --- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c +++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c @@ -332,7 +332,7 @@ static void handle_ra(int sock) { memcpy(&mac, src.sll_addr, sizeof(mac)); DEBUG_MSG("received valid RA from " F_MAC, F_MAC_VAR(mac)); - router_update(&mac, pkt.ra.nd_ra_router_lifetime); + router_update(&mac, ntohs(pkt.ra.nd_ra_router_lifetime)); check_failed: return;