mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
network: Add support to configure DHCPv4 route MTU
This is useful for transitioning systems from small frames to jumbo frames. Closes #14302
This commit is contained in:
parent
a9a5d632da
commit
c695dcf929
@ -1618,6 +1618,13 @@
|
||||
</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>
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -99,6 +99,7 @@ MaxAttempts=
|
||||
IPServiceType=
|
||||
SendOption=
|
||||
SendDecline=
|
||||
RouteMTUBytes=
|
||||
[DHCPv6]
|
||||
UseNTP=
|
||||
UseDNS=
|
||||
|
Loading…
Reference in New Issue
Block a user