diff options
author | Susant Sahani <ssahani@vmware.com> | 2019-08-19 15:30:35 +0530 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-22 13:21:57 +0200 |
commit | 482efedc081b0c4bf2e77a3dee6b979d9c9a5765 (patch) | |
tree | 23b923250f734f38b48ad32ba7a22e1aebb9e7e0 /src | |
parent | d0696f3b7501744d91bcbef83478b9cd4a8160f4 (diff) | |
download | systemd-482efedc081b0c4bf2e77a3dee6b979d9c9a5765.tar.gz |
network: Do not disable IPv6 by writing to sysctl
Only enable is and do not disable IPv6
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-link.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 47d4d08aee..eca65c4fec 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -330,19 +330,20 @@ static IPv6PrivacyExtensions link_ipv6_privacy_extensions(Link *link) { } static int link_enable_ipv6(Link *link) { - bool disabled; + bool enabled; int r; if (link->flags & IFF_LOOPBACK) return 0; - disabled = !link_ipv6_enabled(link); - - r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled); - if (r < 0) - log_link_warning_errno(link, r, "Cannot %s IPv6: %m", enable_disable(!disabled)); - else - log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled)); + enabled = link_ipv6_enabled(link); + if (enabled) { + r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", false); + if (r < 0) + log_link_warning_errno(link, r, "Cannot enable IPv6: %m"); + else + log_link_info(link, "IPv6 successfully enabled"); + } return 0; } @@ -1281,10 +1282,6 @@ int link_set_mtu(Link *link, uint32_t mtu) { if (r < 0) return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m"); - /* If IPv6 not configured (no static IPv6 address and IPv6LL autoconfiguration is disabled) - * for this interface, then disable IPv6 else enable it. */ - (void) link_enable_ipv6(link); - /* IPv6 protocol requires a minimum MTU of IPV6_MTU_MIN(1280) bytes * on the interface. Bump up MTU bytes to IPV6_MTU_MIN. */ if (link_ipv6_enabled(link) && mtu < IPV6_MIN_MTU) { @@ -2554,6 +2551,10 @@ static int link_configure(Link *link) { return r; } + /* If IPv6 configured that is static IPv6 address and IPv6LL autoconfiguration is enabled + * for this interface, then enable IPv6 */ + (void) link_enable_ipv6(link); + r = link_set_proxy_arp(link); if (r < 0) return r; |