From 7c733630c49f1c8a7a43e701fa0b849ab9e473a5 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Wed, 5 Mar 2014 09:11:24 +0100 Subject: [PATCH] ra: don't set nd_ra_{reachable,retransmit} to 0 --- src/ra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ra.c b/src/ra.c index 560552f..3e36f94 100644 --- a/src/ra.c +++ b/src/ra.c @@ -311,11 +311,13 @@ bool ra_process(void) update_proc("conf", "hop_limit", adv->nd_ra_curhoplimit); // Parse ND parameters - if (ntohl(adv->nd_ra_reachable) <= 3600000) - update_proc("neigh", "base_reachable_time_ms", ntohl(adv->nd_ra_reachable)); + uint32_t reachable = ntohl(adv->nd_ra_reachable); + if (reachable > 0 && reachable <= 3600000) + update_proc("neigh", "base_reachable_time_ms", reachable); - if (ntohl(adv->nd_ra_retransmit) <= 60000) - update_proc("neigh", "retrans_time_ms", ntohl(adv->nd_ra_retransmit)); + uint32_t retransmit = ntohl(adv->nd_ra_retransmit); + if (retransmit > 0 && retransmit <= 60000) + update_proc("neigh", "retrans_time_ms", retransmit); // Evaluate options -- 2.25.1