diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 8ac7eb0a8309..267ee76d3ddb 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -771,6 +771,9 @@ tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a) { unsigned char *b = skb_tail_pointer(skb); struct tc_cookie *cookie; + unsigned char *c; + struct nlattr *nest; + int err; if (nla_put_string(skb, TCA_KIND, a->ops->kind)) goto nla_put_failure; @@ -787,6 +790,16 @@ tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a) } rcu_read_unlock(); + c = skb_tail_pointer(skb); + nest = nla_nest_start_noflag(skb, TCA_OPTIONS); + if (nest == NULL) + goto nla_put_failure; + err = tcf_action_dump_old(skb, a, 0, 0); + if (err > 0) { + nla_nest_end(skb, nest); + } + nlmsg_trim(skb, c); + return 0; nla_put_failure: diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 0c574700da75..1bc6294c5c9b 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -2771,8 +2771,10 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh, static int fl_terse_dump(struct net *net, struct tcf_proto *tp, void *fh, struct sk_buff *skb, struct tcmsg *t, bool rtnl_held) { + struct fl_flow_key *key, *mask; struct cls_fl_filter *f = fh; struct nlattr *nest; + unsigned char *b; bool skip_hw; if (!f) @@ -2786,8 +2788,15 @@ static int fl_terse_dump(struct net *net, struct tcf_proto *tp, void *fh, spin_lock(&tp->lock); + key = &f->key; + mask = &f->mask->key; skip_hw = tc_skip_hw(f->flags); + b = skb_tail_pointer(skb); + if (fl_dump_key(skb, net, key, mask)) + goto nla_put_failure_locked; + nlmsg_trim(skb, b); + if (f->flags && nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags)) goto nla_put_failure_locked;