mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
Merge pull request #6134 from pfl/radv_fixes
Router Advertisement fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user