diff mbox series

[net,1/2] Revert "net/sched: act_api: move TCA_EXT_WARN_MSG to the correct hierarchy"

Message ID 20230314065802.1532741-2-liuhangbin@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net/sched: fix parsing of TCA_EXT_WARN_MSG for tc action | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 20 this patch: 20
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 20 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Hangbin Liu March 14, 2023, 6:58 a.m. UTC
This reverts commit 923b2e30dc9cd05931da0f64e2e23d040865c035.

This is not a correct fix as TCA_EXT_WARN_MSG is not a hierarchy to
TCA_ACT_TAB. I didn't notice the TC actions use different enum when adding
TCA_EXT_WARN_MSG. To fix the difference I will add a new WARN enum in
TCA_ROOT_MAX as Jamal suggested.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/sched/act_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jamal Hadi Salim March 14, 2023, 10:32 p.m. UTC | #1
On Tue, Mar 14, 2023 at 2:58 AM Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> This reverts commit 923b2e30dc9cd05931da0f64e2e23d040865c035.
>
> This is not a correct fix as TCA_EXT_WARN_MSG is not a hierarchy to
> TCA_ACT_TAB. I didn't notice the TC actions use different enum when adding
> TCA_EXT_WARN_MSG. To fix the difference I will add a new WARN enum in
> TCA_ROOT_MAX as Jamal suggested.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal


> ---
>  net/sched/act_api.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index 34c508675041..fce522886099 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -1596,12 +1596,12 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
>         if (tcf_action_dump(skb, actions, bind, ref, false) < 0)
>                 goto out_nlmsg_trim;
>
> +       nla_nest_end(skb, nest);
> +
>         if (extack && extack->_msg &&
>             nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg))
>                 goto out_nlmsg_trim;
>
> -       nla_nest_end(skb, nest);
> -
>         nlh->nlmsg_len = skb_tail_pointer(skb) - b;
>
>         return skb->len;
> --
> 2.38.1
>
diff mbox series

Patch

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 34c508675041..fce522886099 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1596,12 +1596,12 @@  static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[],
 	if (tcf_action_dump(skb, actions, bind, ref, false) < 0)
 		goto out_nlmsg_trim;
 
+	nla_nest_end(skb, nest);
+
 	if (extack && extack->_msg &&
 	    nla_put_string(skb, TCA_EXT_WARN_MSG, extack->_msg))
 		goto out_nlmsg_trim;
 
-	nla_nest_end(skb, nest);
-
 	nlh->nlmsg_len = skb_tail_pointer(skb) - b;
 
 	return skb->len;