]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp4: add ability to use BOOTP
authorColin Foster <colin.foster@in-advantage.com>
Tue, 22 Oct 2024 18:26:36 +0000 (13:26 -0500)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 Jun 2025 05:15:04 +0000 (14:15 +0900)
Add the following network option to enable BOOTP:

[DHCPv4]
Bootp=yes

This will allow a two message request / reply sequence that doesn't
require DHCP message types.

Co-authored-by: Avram Dorfman <dorfman@est.org>
man/systemd.network.xml
src/network/networkd-dhcp4.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.h

index 53221cbd5eab5236bee7fb9f7288ed100aa41e1c..c3836b0446eaa4026784c0283e62c074861c39ab 100644 (file)
@@ -2603,6 +2603,16 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>BOOTP=</varname></term>
+        <listitem>
+          <para>Takes a boolean. When enabled, the DHCPv4 client will be configured to communicate with BOOTP
+          servers, rather than with DHCP servers. Defaults to off.</para>
+
+          <xi:include href="version-info.xml" xpointer="v258"/>
+        </listitem>
+      </varlistentry>
+
       <!-- How to use the DHCP lease -->
 
       <varlistentry>
index 7bb203e70a5233e5c665a57dcb567183578d2d84..981b28b77763ee659f45e7eb0549727d7739a9ef 100644 (file)
@@ -1498,6 +1498,11 @@ static int dhcp4_configure(Link *link) {
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to allocate DHCPv4 client: %m");
 
+        r = sd_dhcp_client_set_bootp(link->dhcp_client, link->network->dhcp_use_bootp);
+        if (r < 0)
+                return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to %s BOOTP: %m",
+                                            enable_disable(link->network->dhcp_use_bootp));
+
         r = sd_dhcp_client_attach_event(link->dhcp_client, link->manager->event, 0);
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv4 CLIENT: Failed to attach event to DHCPv4 client: %m");
index 54d2783c8042083d04ac0393ee56a0e3f1c51967..36b833ef369b6806099db223f646cea35b742bf5 100644 (file)
@@ -269,6 +269,7 @@ DHCPv4.QuickAck,                             config_parse_bool,
 DHCPv4.RequestOptions,                       config_parse_dhcp_request_options,                        AF_INET,                       0
 DHCPv4.Anonymize,                            config_parse_bool,                                        0,                             offsetof(Network, dhcp_anonymize)
 DHCPv4.SendHostname,                         config_parse_dhcp_send_hostname,                          AF_INET,                       0
+DHCPv4.BOOTP,                                config_parse_bool,                                        0,                             offsetof(Network, dhcp_use_bootp)
 DHCPv4.Hostname,                             config_parse_hostname,                                    0,                             offsetof(Network, dhcp_hostname)
 DHCPv4.Label,                                config_parse_dhcp_label,                                  0,                             offsetof(Network, dhcp_label)
 DHCPv4.RequestBroadcast,                     config_parse_tristate,                                    0,                             offsetof(Network, dhcp_broadcast)
index 0808fee6943899136390894f2d7a66f2cf5d3a33..51c9160760fb595a609cd60bc7d3eeaf42c2acb2 100644 (file)
@@ -114,6 +114,7 @@ typedef struct Network {
         /* DHCP Client Support */
         AddressFamily dhcp;
         struct in_addr dhcp_request_address;
+        bool dhcp_use_bootp;
         DHCPClientIdentifier dhcp_client_identifier;
         DUID dhcp_duid;
         uint32_t dhcp_iaid;