summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-02-05 11:10:33 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-02-07 05:48:54 +0100
commit2ed5f6d5de387dba1c739b776ffd35e9a1f8de77 (patch)
treeea6fe4e27ede2b0441f8d73bb4f46b326f0263a6
parentcore: sync SeccompParseFlags between dbus-execute and load-fragment (diff)
downloadsystemd-2ed5f6d5de387dba1c739b776ffd35e9a1f8de77.tar.xz
systemd-2ed5f6d5de387dba1c739b776ffd35e9a1f8de77.zip
network: introduce new [QDisc] section to support Parent=ingress
Follow-up for 18de0969c5763ce119692b59f8622c379e79c6cc.
-rw-r--r--man/systemd.network.xml15
-rw-r--r--src/network/networkd-network-gperf.gperf3
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/tc/qdisc.c1
-rw-r--r--test/fuzz/fuzz-network-parser/directives.network2
5 files changed, 20 insertions, 2 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 793243f9ae..d8485f736f 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -2271,6 +2271,21 @@
</refsect1>
<refsect1>
+ <title>[QDisc] Section Options</title>
+ <para>The <literal>[QDisc]</literal> section manages the traffic control queueing discipline (qdisc).</para>
+
+ <variablelist class='network-directives'>
+ <varlistentry>
+ <term><varname>Parent=</varname></term>
+ <listitem>
+ <para>Specifies the parent Queueing Discipline (qdisc). Takes one of <literal>clsact</literal>
+ or <literal>ingress</literal>. This is mandatory.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
<title>[NetworkEmulator] Section Options</title>
<para>The <literal>[NetworkEmulator]</literal> section manages the queueing discipline (qdisc) of
the network emulator. It can be used to configure the kernel packet scheduler and simulate packet
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 369631d9ee..81ce9ee1e4 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -251,6 +251,7 @@ CAN.BitRate, config_parse_si_uint64,
CAN.SamplePoint, config_parse_permille, 0, offsetof(Network, can_sample_point)
CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us)
CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling)
+QDisc.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0
ControlledDelay.Parent, config_parse_qdisc_parent, QDISC_KIND_CODEL, 0
ControlledDelay.PacketLimit, config_parse_controlled_delay_u32, QDISC_KIND_CODEL, 0
ControlledDelay.TargetSec, config_parse_controlled_delay_usec, QDISC_KIND_CODEL, 0
@@ -320,7 +321,7 @@ DHCP.RapidCommit, config_parse_bool,
DHCP.ForceDHCPv6PDOtherInformation, config_parse_bool, 0, offsetof(Network, dhcp6_force_pd_other_information)
DHCPv4.UseDomainName, config_parse_dhcp_use_domains, 0, offsetof(Network, dhcp_use_domains)
DHCPv4.CriticalConnection, config_parse_tristate, 0, offsetof(Network, dhcp_critical)
-TrafficControlQueueingDiscipline.Parent, config_parse_qdisc_parent, QDISC_KIND_NETEM, 0
+TrafficControlQueueingDiscipline.Parent, config_parse_qdisc_parent, _QDISC_KIND_INVALID, 0
TrafficControlQueueingDiscipline.NetworkEmulatorDelaySec, config_parse_network_emulator_delay, 0, 0
TrafficControlQueueingDiscipline.NetworkEmulatorDelayJitterSec, config_parse_network_emulator_delay, 0, 0
TrafficControlQueueingDiscipline.NetworkEmulatorLossRate, config_parse_network_emulator_rate, 0, 0
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 1b9e6a22b4..96f9c785ba 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -482,6 +482,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
"IPv6RoutePrefix\0"
"TrafficControlQueueingDiscipline\0"
"CAN\0"
+ "QDisc\0"
"ControlledDelay\0"
"FairQueueing\0"
"FairQueueingControlledDelay\0"
diff --git a/src/network/tc/qdisc.c b/src/network/tc/qdisc.c
index ee0637bf32..c156fe5ce9 100644
--- a/src/network/tc/qdisc.c
+++ b/src/network/tc/qdisc.c
@@ -254,7 +254,6 @@ int config_parse_qdisc_parent(
assert(lvalue);
assert(rvalue);
assert(data);
- assert(ltype >= 0 && ltype < _QDISC_KIND_MAX);
r = qdisc_new_static(ltype, network, filename, section_line, &qdisc);
if (r < 0)
diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network
index 180a30c32c..5b04fefeb5 100644
--- a/test/fuzz/fuzz-network-parser/directives.network
+++ b/test/fuzz/fuzz-network-parser/directives.network
@@ -270,6 +270,8 @@ SendOption=
[NextHop]
Id=
Gateway=
+[QDisc]
+Parent=
[NetworkEmulator]
Parent=
DelaySec=