Skip to content

Commit f16312b

Browse files
johnousterhoutkuba-moo
authored andcommitted
net: tc: improve qdisc error messages
The existing error message ("Invalid qdisc name") is confusing because it suggests that there is no qdisc with the given name. In fact, the name does refer to a valid qdisc, but it doesn't match the kind of an existing qdisc being modified or replaced. The new error message provides more detail to eliminate confusion. Signed-off-by: John Ousterhout <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ba0209b commit f16312b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/sched/sch_api.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
15601560
}
15611561

15621562
if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], q->ops->id)) {
1563-
NL_SET_ERR_MSG(extack, "Invalid qdisc name");
1563+
NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc");
15641564
return -EINVAL;
15651565
}
15661566

@@ -1670,7 +1670,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
16701670
}
16711671
if (tca[TCA_KIND] &&
16721672
nla_strcmp(tca[TCA_KIND], q->ops->id)) {
1673-
NL_SET_ERR_MSG(extack, "Invalid qdisc name");
1673+
NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc");
16741674
return -EINVAL;
16751675
}
16761676
if (q->flags & TCQ_F_INGRESS) {
@@ -1746,7 +1746,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
17461746
return -EEXIST;
17471747
}
17481748
if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], q->ops->id)) {
1749-
NL_SET_ERR_MSG(extack, "Invalid qdisc name");
1749+
NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc");
17501750
return -EINVAL;
17511751
}
17521752
err = qdisc_change(q, tca, extack);

0 commit comments

Comments
 (0)