diff options
-rw-r--r-- | man/systemd.network.xml | 11 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 1 | ||||
-rw-r--r-- | src/network/networkd-route.c | 35 | ||||
-rw-r--r-- | src/network/networkd-route.h | 1 |
4 files changed, 47 insertions, 1 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml index b52c1ff7e4..82629b9172 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -1099,7 +1099,16 @@ </para> </listitem> </varlistentry> - + <varlistentry> + <term><varname>MTUBytes=</varname></term> + <listitem> + <para>The maximum transmission unit in bytes to set for the + route. The usual suffixes K, M, G, are supported and are + understood to the base of 1024.</para> + <para>Note that if IPv6 is enabled on the interface, and the MTU is chosen + below 1280 (the minimum MTU for IPv6) it will automatically be increased to this value.</para> + </listitem> + </varlistentry> </variablelist> </refsect1> diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index e3d84a365d..23f57ca2f0 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -105,6 +105,7 @@ Route.Metric, config_parse_route_priority, Route.Scope, config_parse_route_scope, 0, 0 Route.PreferredSource, config_parse_preferred_src, 0, 0 Route.Table, config_parse_route_table, 0, 0 +Route.MTUBytes, config_parse_route_mtu, AF_UNSPEC, 0 Route.GatewayOnlink, config_parse_gateway_onlink, 0, 0 Route.IPv6Preference, config_parse_ipv6_route_preference, 0, 0 Route.Protocol, config_parse_route_protocol, 0, 0 diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 63a6b9c2e0..a5303dafa1 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1177,3 +1177,38 @@ int config_parse_quickack( return 0; } + +int config_parse_route_mtu( + const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + + Network *network = userdata; + _cleanup_(route_freep) Route *n = NULL; + int r; + + assert(filename); + assert(section); + assert(lvalue); + assert(rvalue); + assert(data); + + r = route_new_static(network, filename, section_line, &n); + if (r < 0) + return r; + + r = config_parse_mtu(unit, filename, line, section, section_line, lvalue, ltype, rvalue, &n->mtu, userdata); + if (r < 0) + return r; + + n = NULL; + + return 0; +} diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index 138bad7a1a..61a81b4150 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -75,3 +75,4 @@ CONFIG_PARSER_PROTOTYPE(config_parse_route_protocol); CONFIG_PARSER_PROTOTYPE(config_parse_route_type); CONFIG_PARSER_PROTOTYPE(config_parse_tcp_window); CONFIG_PARSER_PROTOTYPE(config_parse_quickack); +CONFIG_PARSER_PROTOTYPE(config_parse_route_mtu); |