From 2677fa10dc2eb455e9135ab40022ae586c651c0f Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 7 Sep 2020 21:35:42 +0200 Subject: router: fix advertisement interval option The variable maxival contains the maximum time in seconds between successive unsolicited Router Advertisement messages; RFC6275 defines the Advertisement Interval option as the time in milliseconds. Therefore convert maxival to milliseconds when populating the Advertisement Interval option. Signed-off-by: Hans Dedecker --- src/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router.c b/src/router.c index 7198ee9..06f3a66 100644 --- a/src/router.c +++ b/src/router.c @@ -732,7 +732,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr memset(&adv_interval, 0, sizeof(adv_interval)); adv_interval.nd_opt_adv_interval_type = ND_OPT_RTR_ADV_INTERVAL; adv_interval.nd_opt_adv_interval_len = 1; - adv_interval.nd_opt_adv_interval_ival = htonl(maxival); + adv_interval.nd_opt_adv_interval_ival = htonl(maxival*1000); iov[IOV_RA_ADV_INTERVAL].iov_base = (char *)&adv_interval; iov[IOV_RA_ADV_INTERVAL].iov_len = adv_interval.nd_opt_adv_interval_len * 8; -- cgit v1.2.3