</listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>InitialCongestionWindow=</varname></term>
+ <listitem>
+ <para>As in the [Route] section.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>InitialAdvertisedReceiveWindow=</varname></term>
+ <listitem>
+ <para>As in the [Route] section.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><varname>UseGateway=</varname></term>
<listitem>
route->mtu = link->network->dhcp_route_mtu;
if (route->quickack < 0)
route->quickack = link->network->dhcp_quickack;
+ if (route->initcwnd == 0)
+ route->initcwnd = link->network->dhcp_initial_congestion_window;
+ if (route->initrwnd == 0)
+ route->initrwnd = link->network->dhcp_advertised_receive_window;
if (route_get(NULL, link, route, &existing) < 0) /* This is a new route. */
link->dhcp4_configured = false;
Route.IPv6Preference, config_parse_ipv6_route_preference, 0, 0
Route.Protocol, config_parse_route_protocol, 0, 0
Route.Type, config_parse_route_type, 0, 0
-Route.InitialCongestionWindow, config_parse_tcp_window, 0, 0
-Route.InitialAdvertisedReceiveWindow, config_parse_tcp_window, 0, 0
+Route.InitialCongestionWindow, config_parse_route_tcp_window, 0, 0
+Route.InitialAdvertisedReceiveWindow, config_parse_route_tcp_window, 0, 0
Route.TCPAdvertisedMaximumSegmentSize, config_parse_tcp_advmss, 0, 0
Route.TCPCongestionControlAlgorithm, config_parse_tcp_congestion, 0, 0
Route.QuickAck, config_parse_route_boolean, 0, 0
DHCPv4.SendOption, config_parse_dhcp_send_option, AF_INET, offsetof(Network, dhcp_client_send_options)
DHCPv4.SendVendorOption, config_parse_dhcp_send_option, 0, offsetof(Network, dhcp_client_send_vendor_options)
DHCPv4.RouteMTUBytes, config_parse_mtu, AF_INET, offsetof(Network, dhcp_route_mtu)
+DHCPv4.InitialCongestionWindow, config_parse_tcp_window, 0, offsetof(Network, dhcp_initial_congestion_window)
+DHCPv4.InitialAdvertisedReceiveWindow, config_parse_tcp_window, 0, offsetof(Network, dhcp_advertised_receive_window)
DHCPv4.FallbackLeaseLifetimeSec, config_parse_dhcp_fallback_lease_lifetime, 0, 0
DHCPv4.Use6RD, config_parse_bool, 0, offsetof(Network, dhcp_use_6rd)
DHCPv4.NetLabel, config_parse_string, CONFIG_PARSE_STRING_SAFE, offsetof(Network, dhcp_netlabel)
bool dhcp_use_routes;
int dhcp_use_gateway;
bool dhcp_quickack;
+ uint32_t dhcp_initial_congestion_window;
+ uint32_t dhcp_advertised_receive_window;
bool dhcp_use_timezone;
bool dhcp_use_hostname;
bool dhcp_use_6rd;
void *data,
void *userdata) {
- _cleanup_(route_free_or_set_invalidp) Route *n = NULL;
- Network *network = userdata;
+ uint32_t *window = ASSERT_PTR(data);
uint32_t k;
int r;
assert(rvalue);
assert(data);
- r = route_new_static(network, filename, section_line, &n);
- if (r == -ENOMEM)
- return log_oom();
- if (r < 0) {
- log_syntax(unit, LOG_WARNING, filename, line, r,
- "Failed to allocate route, ignoring assignment: %m");
- return 0;
- }
-
r = safe_atou32(rvalue, &k);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
return 0;
}
+ *window = k;
+ return 0;
+}
+
+int config_parse_route_tcp_window(
+ 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) {
+
+ _cleanup_(route_free_or_set_invalidp) Route *n = NULL;
+ Network *network = userdata;
+ uint32_t *d;
+ int r;
+
+ assert(filename);
+ assert(section);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ r = route_new_static(network, filename, section_line, &n);
+ if (r == -ENOMEM)
+ return log_oom();
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r,
+ "Failed to allocate route, ignoring assignment: %m");
+ return 0;
+ }
+
if (streq(lvalue, "InitialCongestionWindow"))
- n->initcwnd = k;
+ d = &n->initcwnd;
else if (streq(lvalue, "InitialAdvertisedReceiveWindow"))
- n->initrwnd = k;
+ d = &n->initrwnd;
else
assert_not_reached();
+ r = config_parse_tcp_window(unit, filename, line, section, section_line, lvalue, ltype, rvalue, d, userdata);
+ if (r < 0)
+ return r;
+
TAKE_PTR(n);
return 0;
}
CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_route_preference);
CONFIG_PARSER_PROTOTYPE(config_parse_route_protocol);
CONFIG_PARSER_PROTOTYPE(config_parse_route_type);
+CONFIG_PARSER_PROTOTYPE(config_parse_route_tcp_window);
CONFIG_PARSER_PROTOTYPE(config_parse_tcp_window);
CONFIG_PARSER_PROTOTYPE(config_parse_route_mtu);
CONFIG_PARSER_PROTOTYPE(config_parse_multipath_route);