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 <sven@narfation.org>
This commit is contained in:
Sven Eckelmann 2017-12-20 12:22:46 +01:00 committed by Jan-Philipp Litza
parent 2d6cd71f82
commit 07a760494b
No known key found for this signature in database
GPG Key ID: 1FB658053CE27196

View File

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