diff options
author | Tom Yan <tom.ty89@gmail.com> | 2016-05-25 20:40:48 +0800 |
---|---|---|
committer | Tom Yan <tom.ty89@gmail.com> | 2016-05-25 20:40:48 +0800 |
commit | 4cef7fe3d1e8db7b1c20fb920c6e0ba05b0d2fc0 (patch) | |
tree | e09f1597718c045247786fb771c920a60f57041b /src | |
parent | fbc38f230bcc296772f53898fb79cda7075025b8 (diff) |
networkd: Disable IPv6 when DHCPv6 is only enabled
DHCPv6 requires an IPv6 link-local address to work. The client will not be started (even when enabled explicitly with `DHCP=`) if none is configured (either by autoconfiguration or manually). Therefore, disable IPv6 in such case.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-link.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 9d2f244087..6e6f9618b0 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -110,7 +110,8 @@ static bool link_ipv6_enabled(Link *link) { if (!socket_ipv6_is_supported()) return false; - return link_dhcp6_enabled(link) || link_ipv6ll_enabled(link) || network_has_static_ipv6_addresses(link->network); + /* DHCPv6 client will not be started if no IPv6 link-local address is configured. */ + return link_ipv6ll_enabled(link) || network_has_static_ipv6_addresses(link->network); } static bool link_lldp_rx_enabled(Link *link) { @@ -1577,7 +1578,7 @@ static int link_up(Link *link) { return log_link_error_errno(link, r, "Could not set MAC address: %m"); } - /* If IPv6 not configured (no static IPv6 address and neither DHCPv6 nor IPv6LL is enabled) + /* 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); |