diff options
-rw-r--r-- | net/sched/cls_bpf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index 0590816ab7b0..7d9241545188 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c | |||
@@ -265,8 +265,7 @@ static int cls_bpf_prog_from_ops(struct nlattr **tb, struct cls_bpf_prog *prog) | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | static int cls_bpf_prog_from_efd(struct nlattr **tb, struct cls_bpf_prog *prog, | 268 | static int cls_bpf_prog_from_efd(struct nlattr **tb, struct cls_bpf_prog *prog) |
269 | const struct tcf_proto *tp) | ||
270 | { | 269 | { |
271 | struct bpf_prog *fp; | 270 | struct bpf_prog *fp; |
272 | char *name = NULL; | 271 | char *name = NULL; |
@@ -339,7 +338,7 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp, | |||
339 | prog->exts_integrated = have_exts; | 338 | prog->exts_integrated = have_exts; |
340 | 339 | ||
341 | ret = is_bpf ? cls_bpf_prog_from_ops(tb, prog) : | 340 | ret = is_bpf ? cls_bpf_prog_from_ops(tb, prog) : |
342 | cls_bpf_prog_from_efd(tb, prog, tp); | 341 | cls_bpf_prog_from_efd(tb, prog); |
343 | if (ret < 0) { | 342 | if (ret < 0) { |
344 | tcf_exts_destroy(&exts); | 343 | tcf_exts_destroy(&exts); |
345 | return ret; | 344 | return ret; |
@@ -468,6 +467,7 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, | |||
468 | { | 467 | { |
469 | struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh; | 468 | struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh; |
470 | struct nlattr *nest; | 469 | struct nlattr *nest; |
470 | u32 bpf_flags = 0; | ||
471 | int ret; | 471 | int ret; |
472 | 472 | ||
473 | if (prog == NULL) | 473 | if (prog == NULL) |
@@ -492,6 +492,11 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, | |||
492 | if (tcf_exts_dump(skb, &prog->exts) < 0) | 492 | if (tcf_exts_dump(skb, &prog->exts) < 0) |
493 | goto nla_put_failure; | 493 | goto nla_put_failure; |
494 | 494 | ||
495 | if (prog->exts_integrated) | ||
496 | bpf_flags |= TCA_BPF_FLAG_ACT_DIRECT; | ||
497 | if (bpf_flags && nla_put_u32(skb, TCA_BPF_FLAGS, bpf_flags)) | ||
498 | goto nla_put_failure; | ||
499 | |||
495 | nla_nest_end(skb, nest); | 500 | nla_nest_end(skb, nest); |
496 | 501 | ||
497 | if (tcf_exts_dump_stats(skb, &prog->exts) < 0) | 502 | if (tcf_exts_dump_stats(skb, &prog->exts) < 0) |