summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-04 05:32:44 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-11-09 10:58:44 +0900
commitd05dce95d87bc3070064e5a34486f8b2aff87d78 (patch)
tree171305f08e8f3b5140de6b52ee635afb9f06f631
parent049b66ccdd096173c0806903cb9d263605acdcbb (diff)
downloadsystemd-d05dce95d87bc3070064e5a34486f8b2aff87d78.tar.gz
network: tc/cake: introduce Wash= setting
-rw-r--r--man/systemd.network.xml8
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/tc/cake.c9
-rw-r--r--src/network/tc/cake.h3
-rw-r--r--test/fuzz/fuzz-network-parser/directives.network1
5 files changed, 22 insertions, 0 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 3cc9e8e778..78c0f6cd57 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -3669,6 +3669,14 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><varname>Wash=</varname></term>
+ <listitem>
+ <para>Takes a boolean value. When true, CAKE clears the DSCP fields, except for ECN bits, of
+ any packet passing through CAKE. Defaults to unset, and the kernel's default is used.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index f7866cbc14..956d7b130e 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -394,6 +394,7 @@ CAKE.FlowIsolationMode, config_parse_cake_flow_isolation_mo
CAKE.NAT, config_parse_cake_tristate, QDISC_KIND_CAKE, 0
CAKE.PriorityQueueingPreset, config_parse_cake_priority_queueing_preset, QDISC_KIND_CAKE, 0
CAKE.FirewallMark, config_parse_cake_fwmark, QDISC_KIND_CAKE, 0
+CAKE.Wash, config_parse_cake_tristate, QDISC_KIND_CAKE, 0
ControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_CODEL, 0
ControlledDelay.Handle, config_parse_qdisc_handle, QDISC_KIND_CODEL, 0
ControlledDelay.PacketLimit, config_parse_controlled_delay_u32, QDISC_KIND_CODEL, 0
diff --git a/src/network/tc/cake.c b/src/network/tc/cake.c
index 598a019ac2..cad36dc237 100644
--- a/src/network/tc/cake.c
+++ b/src/network/tc/cake.c
@@ -24,6 +24,7 @@ static int cake_init(QDisc *qdisc) {
c->flow_isolation_mode = _CAKE_FLOW_ISOLATION_MODE_INVALID;
c->nat = -1;
c->preset = _CAKE_PRESET_INVALID;
+ c->wash = -1;
return 0;
}
@@ -96,6 +97,12 @@ static int cake_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req)
return log_link_error_errno(link, r, "Could not append TCA_CAKE_FWMARK attribute: %m");
}
+ if (c->wash >= 0) {
+ r = sd_netlink_message_append_u32(req, TCA_CAKE_WASH, c->wash);
+ if (r < 0)
+ return log_link_error_errno(link, r, "Could not append TCA_CAKE_WASH attribute: %m");
+ }
+
r = sd_netlink_message_close_container(req);
if (r < 0)
return log_link_error_errno(link, r, "Could not close container TCA_OPTIONS: %m");
@@ -314,6 +321,8 @@ int config_parse_cake_tristate(
dest = &c->autorate;
else if (streq(lvalue, "NAT"))
dest = &c->nat;
+ else if (streq(lvalue, "Wash"))
+ dest = &c->wash;
else
assert_not_reached();
diff --git a/src/network/tc/cake.h b/src/network/tc/cake.h
index 8743d592ad..a947f9cdc7 100644
--- a/src/network/tc/cake.h
+++ b/src/network/tc/cake.h
@@ -59,6 +59,9 @@ typedef struct CommonApplicationsKeptEnhanced {
CakePriorityQueueingPreset preset;
uint32_t fwmark;
+ /* Other parameters */
+ int wash;
+
} CommonApplicationsKeptEnhanced;
DEFINE_QDISC_CAST(CAKE, CommonApplicationsKeptEnhanced);
diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network
index de8bec2750..92c942c708 100644
--- a/test/fuzz/fuzz-network-parser/directives.network
+++ b/test/fuzz/fuzz-network-parser/directives.network
@@ -476,6 +476,7 @@ FlowIsolationMode=
NAT=
PriorityQueueingPreset=
FirewallMark=
+Wash=
[TrafficControlQueueingDiscipline]
Parent=
NetworkEmulatorDelaySec=