]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Add support to configure DHCPv4 route MTU
authorSusant Sahani <ssahani@vmware.com>
Thu, 19 Dec 2019 10:05:16 +0000 (11:05 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 28 Dec 2019 12:37:26 +0000 (21:37 +0900)
This is useful for transitioning systems from small frames to jumbo frames.

Closes #14302

man/systemd.network.xml
src/network/networkd-dhcp4.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.h
test/fuzz/fuzz-network-parser/directives.network

index 45b976305b86f78463027ee077c1782c93c0e04c..0549c02968a41ed59ac650914d93dae12e514134 100644 (file)
           </listitem>
         </varlistentry>
 
+        <varlistentry>
+          <term><varname>RouteMTUBytes=</varname></term>
+          <listitem>
+            <para>Specifies the MTU for the DHCP routes. Please see the [Route] section for further details.</para>
+          </listitem>
+        </varlistentry>
+
         <varlistentry>
           <term><varname>ListenPort=</varname></term>
           <listitem>
index fc8f44d6aaab73860f37418b5ac4b177c9047f8a..66d83e76bfae4ffd3c590999c01cc051d3b4445f 100644 (file)
@@ -310,6 +310,7 @@ static int link_set_dhcp_routes(Link *link) {
                 assert_se(sd_dhcp_route_get_destination_prefix_length(static_routes[i], &route->dst_prefixlen) >= 0);
                 route->priority = link->network->dhcp_route_metric;
                 route->table = table;
+                route->mtu = link->network->dhcp_route_mtu;
                 route->scope = route_scope_from_address(route, &address);
                 if (IN_SET(route->scope, RT_SCOPE_LINK, RT_SCOPE_UNIVERSE))
                         route->prefsrc.in = address;
@@ -353,6 +354,7 @@ static int link_set_dhcp_routes(Link *link) {
                 route_gw->protocol = RTPROT_DHCP;
                 route_gw->priority = link->network->dhcp_route_metric;
                 route_gw->table = table;
+                route_gw->mtu = link->network->dhcp_route_mtu;
 
                 r = dhcp_route_configure(&route_gw, link);
                 if (r < 0)
@@ -368,6 +370,7 @@ static int link_set_dhcp_routes(Link *link) {
                 route->protocol = RTPROT_DHCP;
                 route->priority = link->network->dhcp_route_metric;
                 route->table = table;
+                route->mtu = link->network->dhcp_route_mtu;
 
                 r = dhcp_route_configure(&route, link);
                 if (r < 0)
index 7c13973f9089689b277450b9918e7959c2a9f8c4..4912b5e8149816a348d45a8e7bf3dcd60484eeb9 100644 (file)
@@ -178,6 +178,7 @@ DHCPv4.SendDecline,                     config_parse_bool,
 DHCPv4.BlackList,                       config_parse_dhcp_black_listed_ip_address,       0,                             0
 DHCPv4.IPServiceType,                   config_parse_ip_service_type,                    0,                             offsetof(Network, ip_service_type)
 DHCPv4.SendOption,                      config_parse_dhcp_send_option,                   0,                             offsetof(Network, dhcp_client_send_options)
+DHCPv4.RouteMTUBytes,                   config_parse_mtu,                                AF_INET,                       offsetof(Network, dhcp_route_mtu)
 DHCPv6.UseDNS,                          config_parse_bool,                               0,                             offsetof(Network, dhcp6_use_dns)
 DHCPv6.UseNTP,                          config_parse_bool,                               0,                             offsetof(Network, dhcp6_use_ntp)
 DHCPv6.RapidCommit,                     config_parse_bool,                               0,                             offsetof(Network, rapid_commit)
index 4f229103a7b038762af630b8b6378432e031d338..783f23c5dd09fa0d43fbef2a6420f01772bd597e 100644 (file)
@@ -95,6 +95,7 @@ struct Network {
         uint64_t dhcp_max_attempts;
         unsigned dhcp_route_metric;
         uint32_t dhcp_route_table;
+        uint32_t dhcp_route_mtu;
         uint16_t dhcp_client_port;
         int dhcp_critical;
         int ip_service_type;
index 76939b15d3a750af867d015cdf0b659a9ce36822..6c306d6dd5dc4ecbe903571a6039da05347fb234 100644 (file)
@@ -99,6 +99,7 @@ MaxAttempts=
 IPServiceType=
 SendOption=
 SendDecline=
+RouteMTUBytes=
 [DHCPv6]
 UseNTP=
 UseDNS=