Thread View: linux.kernel.netdev
5 messages
5 total messages
Started by Dave Seddon
Sun, 29 Nov 2026 23:21
[PATCH iproute2 0/4] tc: four small fixes
Author: Dave Seddon
Date: Sun, 29 Nov 2026 23:21
Date: Sun, 29 Nov 2026 23:21
23 lines
11040 bytes
11040 bytes
Four small, independent tc fixes. Each message has a command that shows the problem on current main. Patches 3 and 4 have no Fixes tag: the code dates from the initial 2004 import. Dave Seddon (4): tc: netem: mark TCA_NETEM_CORR present for duplicate tc: sfq: reject avpkt 0 tc: actions: fail list and flush of an unknown action kind tc: return after usage() for help tc/m_action.c | 2 ++ tc/q_netem.c | 1 + tc/q_sfq.c | 2 +- tc/tc_class.c | 2 ++ tc/tc_filter.c | 1 + tc/tc_qdisc.c | 2 ++ 6 files changed, 9 insertions(+), 1 deletion(-) -- 2.56.0
[PATCH iproute2 1/4] tc: netem: mark TCA_NETEM_CORR present for duplicate
Author: Dave Seddon
Date: Sun, 29 Nov 2026 23:21
Date: Sun, 29 Nov 2026 23:21
30 lines
11483 bytes
11483 bytes
Count TCA_NETEM_CORR as present for a duplicate correlation, as the
other arms do. Without it a duplicate correlation on its own is not
sent:
# tc qdisc add dev lo root netem duplicate 10% 25%
# tc qdisc show dev lo
shows "duplicate 10%", not "duplicate 10% 25%".
Fixes: 40076f622e0a ("netem parameters to change command")
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
tc/q_netem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 0e47765b..f03d0d70 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -407,6 +407,7 @@ random_loss_model:
}
if (NEXT_IS_NUMBER()) {
NEXT_ARG();
+ ++present[TCA_NETEM_CORR];
if (get_percent(&cor.dup_corr, *argv)) {
explain1("duplicate");
return -1;
--
2.56.0
[PATCH iproute2 2/4] tc: sfq: reject avpkt 0
Author: Dave Seddon
Date: Sun, 29 Nov 2026 23:21
Date: Sun, 29 Nov 2026 23:21
28 lines
11460 bytes
11460 bytes
Treat "avpkt 0" as illegal. It is used as a divisor, so
# tc qdisc add dev lo root sfq redflowlimit 100000 avpkt 0
dies with a floating point exception.
Fixes: 6987ecf0832d ("sfq: add optional RED on top of SFQ")
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
tc/q_sfq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/q_sfq.c b/tc/q_sfq.c
index 37ebd977..5ed1ad07 100644
--- a/tc/q_sfq.c
+++ b/tc/q_sfq.c
@@ -119,7 +119,7 @@ static int sfq_parse_opt(const struct qdisc_util *qu, int argc, char **argv, str
red++;
} else if (strcmp(*argv, "avpkt") == 0) {
NEXT_ARG();
- if (get_size(&avpkt, *argv)) {
+ if (get_size(&avpkt, *argv) || !avpkt) {
fprintf(stderr, "Illegal \"avpkt\"\n");
return -1;
}
--
2.56.0
[PATCH iproute2 3/4] tc: actions: fail list and flush of an unknown action kind
Author: Dave Seddon
Date: Sun, 29 Nov 2026 23:21
Date: Sun, 29 Nov 2026 23:21
33 lines
11468 bytes
11468 bytes
Set ret to -1 on the "bad action" paths of tc_act_list_or_flush(),
which exit 0 today:
# tc actions ls action nosuch
bad action nosuch
# echo $?
0
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
tc/m_action.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tc/m_action.c b/tc/m_action.c
index bbc8e6a6..ee6d2aac 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -791,10 +791,12 @@ static int tc_act_list_or_flush(int *argc_p, char ***argv_p, int event)
a = get_action_kind(k);
if (a == NULL) {
fprintf(stderr, "bad action %s\n", k);
+ ret = -1;
goto bad_val;
}
if (strcmp(a->id, k) != 0) {
fprintf(stderr, "bad action %s\n", k);
+ ret = -1;
goto bad_val;
}
strncpy(k, *argv, sizeof(k) - 1);
--
2.56.0
[PATCH iproute2 4/4] tc: return after usage() for help
Author: Dave Seddon
Date: Sun, 29 Nov 2026 23:21
Date: Sun, 29 Nov 2026 23:21
73 lines
12878 bytes
12878 bytes
Return after usage() for "help" in the qdisc and class add paths and in
the qdisc, class and filter show paths, as tc_filter_modify() does. Today
# tc qdisc add dev lo root handle 1: help pfifo
prints the usage and then adds the pfifo, and
# tc qdisc show dev lo help
prints the usage and then the qdiscs.
Signed-off-by: Dave Seddon <dave.seddon.ca@gmail.com>
---
tc/tc_class.c | 2 ++
tc/tc_filter.c | 1 +
tc/tc_qdisc.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 82f0f85e..7f9c961d 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -104,6 +104,7 @@ static int tc_class_modify(int cmd, unsigned int flags, int argc, char **argv)
return -1;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
strncpy(k, *argv, sizeof(k)-1);
@@ -435,6 +436,7 @@ static int tc_class_list(int argc, char **argv)
req.t.tcm_parent = handle;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
fprintf(stderr, "What is \"%s\"? Try \"tc class help\".\n", *argv);
return -1;
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index 7b504029..a67288e4 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -690,6 +690,7 @@ static int tc_filter_list(int cmd, int argc, char **argv)
filter_chain_index = chain_index;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
fprintf(stderr,
" What is \"%s\"? Try \"tc filter help\"\n",
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 7c3e7cb3..18818fbf 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -132,6 +132,7 @@ static int tc_qdisc_modify(int cmd, unsigned int flags, int argc, char **argv)
invarg("invalid egress block index value", *argv);
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else {
strncpy(k, *argv, sizeof(k)-1);
@@ -398,6 +399,7 @@ static int tc_qdisc_list(int argc, char **argv)
filter_handle = handle;
} else if (matches(*argv, "help") == 0) {
usage();
+ return 0;
} else if (strcmp(*argv, "invisible") == 0) {
dump_invisible = true;
} else {
--
2.56.0
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads