mirror of
https://github.com/systemd/systemd.git
synced 2025-01-25 10:04:04 +03:00
network: add [DHCPServer] RapidCommit= setting
This commit is contained in:
parent
538ff0a60a
commit
1fa0a4eff7
@ -3768,6 +3768,18 @@ ServerAddress=192.168.0.1/24</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>RapidCommit=</varname></term>
|
||||
<listitem>
|
||||
<para>Takes a boolean. When true, the server supports
|
||||
<ulink url="https://datatracker.ietf.org/doc/html/rfc4039">RFC 4039</ulink>. When a client sends
|
||||
a DHCPDISCOVER message with the Rapid Commit option to the server, then the server will reply with
|
||||
a DHCPACK message to the client, instead of DHCPOFFER. Defaults to true.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v255"/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@ -418,6 +418,11 @@ static int dhcp4_server_configure(Link *link) {
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to set boot filename for DHCPv4 server instance: %m");
|
||||
|
||||
r = sd_dhcp_server_set_rapid_commit(link->dhcp_server, link->network->dhcp_server_rapid_commit);
|
||||
if (r < 0)
|
||||
return log_link_warning_errno(link, r, "Failed to %s Rapid Commit support for DHCPv4 server instance: %m",
|
||||
enable_disable(link->network->dhcp_server_rapid_commit));
|
||||
|
||||
for (sd_dhcp_lease_server_type_t type = 0; type < _SD_DHCP_LEASE_SERVER_TYPE_MAX; type ++) {
|
||||
|
||||
if (!link->network->dhcp_server_emit[type].emit)
|
||||
|
@ -342,6 +342,7 @@ DHCPServer.BindToInterface, config_parse_bool,
|
||||
DHCPServer.BootServerAddress, config_parse_in_addr_non_null, AF_INET, offsetof(Network, dhcp_server_boot_server_address)
|
||||
DHCPServer.BootServerName, config_parse_dns_name, 0, offsetof(Network, dhcp_server_boot_server_name)
|
||||
DHCPServer.BootFilename, config_parse_string, CONFIG_PARSE_STRING_SAFE_AND_ASCII, offsetof(Network, dhcp_server_boot_filename)
|
||||
DHCPServer.RapidCommit, config_parse_bool, 0, offsetof(Network, dhcp_server_rapid_commit)
|
||||
DHCPServerStaticLease.Address, config_parse_dhcp_static_lease_address, 0, 0
|
||||
DHCPServerStaticLease.MACAddress, config_parse_dhcp_static_lease_hwaddr, 0, 0
|
||||
Bridge.Cost, config_parse_uint32, 0, offsetof(Network, cost)
|
||||
|
@ -428,6 +428,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
|
||||
.dhcp_server_emit[SD_DHCP_LEASE_SIP].emit = true,
|
||||
.dhcp_server_emit_router = true,
|
||||
.dhcp_server_emit_timezone = true,
|
||||
.dhcp_server_rapid_commit = true,
|
||||
|
||||
.router_lifetime_usec = RADV_DEFAULT_ROUTER_LIFETIME_USEC,
|
||||
.router_dns_lifetime_usec = RADV_DEFAULT_VALID_LIFETIME_USEC,
|
||||
|
@ -228,6 +228,7 @@ struct Network {
|
||||
char *dhcp_server_boot_server_name;
|
||||
char *dhcp_server_boot_filename;
|
||||
usec_t dhcp_server_ipv6_only_preferred_usec;
|
||||
bool dhcp_server_rapid_commit;
|
||||
|
||||
/* link-local addressing support */
|
||||
AddressFamily link_local;
|
||||
|
Loading…
x
Reference in New Issue
Block a user