summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c25
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;