diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-07-22 06:11:20 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-07-22 14:28:20 +0200 |
commit | 50ee1fec3a7db383903ce9870239161bce908787 (patch) | |
tree | d1fc134113a5992526e7490503e206377f0e49eb /src/network | |
parent | sd-dhcp6-client: introduce sd_dhcp6_client_set_rapid_commit() (diff) | |
download | systemd-50ee1fec3a7db383903ce9870239161bce908787.tar.xz systemd-50ee1fec3a7db383903ce9870239161bce908787.zip |
network: dhcp6: re-introduce RapidCommit= setting
Previous implementation of disabling rapid commit was broken, and
dropped by 308d01f3c4decf3240ca0c6c7f91049953df7299.
Let's re-introduce the option in the correct way, as some servers seem
to return borked message when the solicit message contain the rapid
commit option.
Closes #24065.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-dhcp6.c | 6 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 4 | ||||
-rw-r--r-- | src/network/networkd-network.c | 1 | ||||
-rw-r--r-- | src/network/networkd-network.h | 1 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index d6f2c2cca3..7f9f4e12b9 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -695,6 +695,12 @@ static int dhcp6_configure(Link *link) { return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to set prefix delegation hint: %m"); } + r = sd_dhcp6_client_set_rapid_commit(client, link->network->dhcp6_use_rapid_commit); + if (r < 0) + return log_link_debug_errno(link, r, + "DHCPv6 CLIENT: Failed to %s rapid commit: %m", + enable_disable(link->network->dhcp6_use_rapid_commit)); + link->dhcp6_client = TAKE_PTR(client); return 0; diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 13d521e37a..a4f038681a 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -262,6 +262,7 @@ DHCPv6.SendOption, config_parse_dhcp_send_option, DHCPv6.IAID, config_parse_iaid, AF_INET6, 0 DHCPv6.DUIDType, config_parse_duid_type, 0, offsetof(Network, dhcp6_duid) DHCPv6.DUIDRawData, config_parse_duid_rawdata, 0, offsetof(Network, dhcp6_duid) +DHCPv6.RapidCommit, config_parse_bool, 0, offsetof(Network, dhcp6_use_rapid_commit) IPv6AcceptRA.UseGateway, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_gateway) IPv6AcceptRA.UseRoutePrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_route_prefix) IPv6AcceptRA.UseAutonomousPrefix, config_parse_bool, 0, offsetof(Network, ipv6_accept_ra_use_autonomous_prefix) @@ -555,12 +556,11 @@ DHCP.RouteMetric, config_parse_dhcp_or_ra_route_metri DHCP.RouteTable, config_parse_dhcp_or_ra_route_table, AF_INET, 0 DHCP.UseTimezone, config_parse_bool, 0, offsetof(Network, dhcp_use_timezone) DHCP.ListenPort, config_parse_uint16, 0, offsetof(Network, dhcp_client_port) -DHCP.RapidCommit, config_parse_warn_compat, DISABLED_LEGACY, 0 +DHCP.RapidCommit, config_parse_bool, 0, offsetof(Network, dhcp6_use_rapid_commit) DHCP.ForceDHCPv6PDOtherInformation, config_parse_warn_compat, DISABLED_LEGACY, 0 DHCPv4.UseDomainName, config_parse_dhcp_use_domains, AF_INET, 0 DHCPv4.CriticalConnection, config_parse_tristate, 0, offsetof(Network, dhcp_critical) DHCPv6.RouteMetric, config_parse_dhcp_or_ra_route_metric, AF_INET6, 0 -DHCPv6.RapidCommit, config_parse_warn_compat, DISABLED_LEGACY, 0 DHCPv6.ForceDHCPv6PDOtherInformation, config_parse_warn_compat, DISABLED_LEGACY, 0 DHCPv6PrefixDelegation.SubnetId, config_parse_dhcp_pd_subnet_id, 0, offsetof(Network, dhcp_pd_subnet_id) DHCPv6PrefixDelegation.Announce, config_parse_bool, 0, offsetof(Network, dhcp_pd_announce) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index e090a78023..4faa43b327 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -414,6 +414,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi .dhcp6_use_dns = true, .dhcp6_use_hostname = true, .dhcp6_use_ntp = true, + .dhcp6_use_rapid_commit = true, .dhcp6_duid.type = _DUID_TYPE_INVALID, .dhcp6_client_start_mode = _DHCP6_CLIENT_START_MODE_INVALID, diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index c653124a9c..3df7eee555 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -164,6 +164,7 @@ struct Network { bool dhcp6_use_hostname; bool dhcp6_use_ntp; bool dhcp6_use_ntp_set; + bool dhcp6_use_rapid_commit; DHCPUseDomains dhcp6_use_domains; bool dhcp6_use_domains_set; uint32_t dhcp6_iaid; |