router: fix invalid router lifetime
authorSteven Barth <steven@midlink.org>
Tue, 14 Jul 2015 19:49:57 +0000 (21:49 +0200)
committerSteven Barth <steven@midlink.org>
Tue, 14 Jul 2015 19:49:57 +0000 (21:49 +0200)
src/router.c

index fada62b8486da9328b11e20d0a2c7e50ef4715dc..51fd95420a7ef9615d7624148ede0e50e607f52e 100644 (file)
@@ -437,7 +437,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
 
        minival = (maxival * 3) / 4;
        if (adv.h.nd_ra_router_lifetime)
-               adv.h.nd_ra_router_lifetime = htons(maxvalid);
+               adv.h.nd_ra_router_lifetime = htons(maxvalid / 1000);
 
        odhcpd_urandom(&msecs, sizeof(msecs));
        msecs = (labs(msecs) % (maxival - minival)) + minival;