summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2020-09-07 21:35:42 +0200
committerHans Dedecker <dedeckeh@gmail.com>2020-09-07 21:45:22 +0200
commit2677fa10dc2eb455e9135ab40022ae586c651c0f (patch)
tree698c993b321ad96d2380258b5e1196ca72591a8a
parent5da52992a3926b36e53d0a5d55955a6ccbc35872 (diff)
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 <dedeckeh@gmail.com>
-rw-r--r--src/router.c2
1 files changed, 1 insertions, 1 deletions
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;