From: Hans Dedecker Date: Mon, 7 Sep 2020 19:35:42 +0000 (+0200) Subject: router: fix advertisement interval option X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2677fa10dc2eb455e9135ab40022ae586c651c0f;p=project%2Fodhcpd.git 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 --- 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;