]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: fix default value of DHCPv6Client
authorChristof Efkemann <christof@efkemann.net>
Sun, 15 Nov 2020 19:08:39 +0000 (20:08 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Nov 2020 07:09:37 +0000 (16:09 +0900)
The configuration of networkd has a DHCPv6Client setting in its
[IPv6AcceptRA] section, which, according to the man page, can be
a boolean, or the special value "always". The man page states
that "true" is the default.

The default value is implemented in src/network/networkd-network.c
by setting field ipv6_accept_ra_start_dhcp6_client of network to
true. However, this field is not a boolean, but an enum type
IPv6AcceptRAStartDHCP6Client (src/network/networkd-ndisc.h).

Setting ipv6_accept_ra_start_dhcp6_client to true effectively
corresponds to the enum value IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS,
resulting in the DHCPv6Client setting having the default value
"always".

This patch changes the initialisation to the correct enum value
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES.

src/network/networkd-network.c

index 00bd73560ccbd661c775d924edff9df944270036..32546414610a7fc6958ec0ab36f4241d6a110459 100644 (file)
@@ -422,7 +422,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
                 .ipv6_accept_ra_use_onlink_prefix = true,
                 .ipv6_accept_ra_route_table = RT_TABLE_MAIN,
                 .ipv6_accept_ra_route_table_set = false,
-                .ipv6_accept_ra_start_dhcp6_client = true,
+                .ipv6_accept_ra_start_dhcp6_client = IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES,
 
                 .can_triple_sampling = -1,
                 .can_termination = -1,