1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-29 06:50:16 +03:00

network: read sysctl value only once (#12990)

Follow-up for bafa9641446852f7fa15ca12d08a223d345c78ea.

When the value is changed, networkd needs to be restarted.
This commit is contained in:
Yu Watanabe 2019-07-09 16:56:50 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 8164e30603
commit 593aee8f3c

View File

@ -72,6 +72,12 @@ int link_sysctl_ipv6_enabled(Link *link) {
_cleanup_free_ char *value = NULL;
int r;
assert(link);
assert(link->ifname);
if (link->sysctl_ipv6_enabled >= 0)
return link->sysctl_ipv6_enabled;
r = sysctl_read_ip_property(AF_INET6, link->ifname, "disable_ipv6", &value);
if (r < 0)
return log_link_warning_errno(link, r,