Wed, Dec 20, 2017 at 06:35:12PM CET, [email protected] wrote:
>This patch adds extack support for generic qdisc handling. The extack
>will be set deeper to each called function which is not part of netdev
>core api.
>
>Cc: David Ahern <[email protected]>
>Acked-by: Jamal Hadi Salim <[email protected]>
>Signed-off-by: Alexander Aring <[email protected]>
>---

[...]


>@@ -1349,21 +1387,33 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct 
>nlmsghdr *n,
> 
>               if (!q || !tcm->tcm_handle || q->handle != tcm->tcm_handle) {
>                       if (tcm->tcm_handle) {
>-                              if (q && !(n->nlmsg_flags & NLM_F_REPLACE))
>+                              if (q && !(n->nlmsg_flags & NLM_F_REPLACE)) {
>+                                      NL_SET_ERR_MSG(extack, "NLM_F_REPLACE 
>needed to override");
>                                       return -EEXIST;
>-                              if (TC_H_MIN(tcm->tcm_handle))
>+                              }
>+                              if (TC_H_MIN(tcm->tcm_handle)) {
>+                                      NL_SET_ERR_MSG(extack, "Invalid minor 
>handle");
>                                       return -EINVAL;
>+                              }
>                               q = qdisc_lookup(dev, tcm->tcm_handle);
>-                              if (!q)
>+                              if (!q) {
>+                                      NL_SET_ERR_MSG(extack, "No qdisc found 
>for specified handle");

This is incorrect. This is hit on successpath as well, confusing user
with the message. I will send fix shortly.


>                                       goto create_n_graft;
>-                              if (n->nlmsg_flags & NLM_F_EXCL)
>+                              }

Reply via email to