Merge pull request #6134 from pfl/radv_fixes

Router Advertisement fixes
This commit is contained in:
Lennart Poettering
2017-06-16 22:43:36 +02:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -1166,14 +1166,13 @@ int config_parse_prefix_lifetime(const char *unit,
return 0;
}
/* a value of 0xffffffff represents infinity, 0x0 means this host is
not a router */
/* a value of 0xffffffff represents infinity */
if (streq(lvalue, "PreferredLifetimeSec"))
r = sd_radv_prefix_set_preferred_lifetime(p->radv_prefix,
(usec + USEC_PER_SEC - 1) / USEC_PER_SEC);
DIV_ROUND_UP(usec, USEC_PER_SEC));
else if (streq(lvalue, "ValidLifetimeSec"))
r = sd_radv_prefix_set_valid_lifetime(p->radv_prefix,
(usec + USEC_PER_SEC - 1) / USEC_PER_SEC);
DIV_ROUND_UP(usec, USEC_PER_SEC));
if (r < 0)
return r;

View File

@@ -55,8 +55,10 @@ int radv_configure(Link *link) {
if (r < 0)
return r;
/* a value of 0xffffffff represents infinity, 0x0 means this host is
not a router */
r = sd_radv_set_router_lifetime(link->radv,
link->network->router_lifetime_usec);
DIV_ROUND_UP(link->network->router_lifetime_usec, USEC_PER_SEC));
if (r < 0)
return r;