]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: enable ipv6 when the network has static ipv6 configurations
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 Aug 2019 14:15:24 +0000 (23:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 Aug 2019 14:53:46 +0000 (23:53 +0900)
src/network/networkd-link.c
src/network/networkd-network.c
src/network/networkd-network.h

index 47d4d08aeea6ecef337cc003ac264c10b94314cd..560d8e97b6c4d71f6dd8fa0635a299d16f1d6b2c 100644 (file)
@@ -221,7 +221,13 @@ static bool link_ipv6_enabled(Link *link) {
                 return false;
 
         /* 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);
+        if (link_ipv6ll_enabled(link))
+                return true;
+
+        if (network_has_static_ipv6_configurations(link->network))
+                return true;
+
+        return false;
 }
 
 static bool link_radv_enabled(Link *link) {
index 6a8766ce689d44b17d08fdfe5cf4123200aa2f71..91326cea3bd259f04b861e4cd5b27aacb5119d7b 100644 (file)
@@ -662,15 +662,35 @@ int network_apply(Network *network, Link *link) {
         return 0;
 }
 
-bool network_has_static_ipv6_addresses(Network *network) {
+bool network_has_static_ipv6_configurations(Network *network) {
         Address *address;
+        Route *route;
+        FdbEntry *fdb;
+        Neighbor *neighbor;
 
         assert(network);
 
-        LIST_FOREACH(addresses, address, network->static_addresses) {
+        LIST_FOREACH(addresses, address, network->static_addresses)
                 if (address->family == AF_INET6)
                         return true;
-        }
+
+        LIST_FOREACH(routes, route, network->static_routes)
+                if (route->family == AF_INET6)
+                        return true;
+
+        LIST_FOREACH(static_fdb_entries, fdb, network->static_fdb_entries)
+                if (fdb->family == AF_INET6)
+                        return true;
+
+        LIST_FOREACH(neighbors, neighbor, network->neighbors)
+                if (neighbor->family == AF_INET6)
+                        return true;
+
+        if (!LIST_IS_EMPTY(network->address_labels))
+                return true;
+
+        if (!LIST_IS_EMPTY(network->static_prefixes))
+                return true;
 
         return false;
 }
index f8894f86dda5c47dd86c9b215e6a2360ff752652..bc760744e5f5647badc3584c69f5a79bf03fc9b3 100644 (file)
@@ -269,7 +269,7 @@ int network_get(Manager *manager, sd_device *device, const char *ifname, const s
 int network_apply(Network *network, Link *link);
 void network_apply_anonymize_if_set(Network *network);
 
-bool network_has_static_ipv6_addresses(Network *network);
+bool network_has_static_ipv6_configurations(Network *network);
 
 CONFIG_PARSER_PROTOTYPE(config_parse_stacked_netdev);
 CONFIG_PARSER_PROTOTYPE(config_parse_tunnel);