]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
{f,m}_bpf: dump tag over insns
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 23 Feb 2017 12:07:14 +0000 (13:07 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 23 Feb 2017 17:02:19 +0000 (09:02 -0800)
We already export TCA_BPF_TAG resp. TCA_ACT_BPF_TAG from kernel commit
f1f7714ea51c ("bpf: rework prog_digest into prog_tag"), thus also dump
it when filter/actions are shown.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tc/f_bpf.c
tc/m_bpf.c

index c4764d8f0a048f91f72a930d2f97e51dfc0be4d0..df8a259e18712e9e513c5ec54aeaa7d84678492a 100644 (file)
@@ -216,6 +216,15 @@ static int bpf_print_opt(struct filter_util *qu, FILE *f,
                bpf_print_ops(f, tb[TCA_BPF_OPS],
                              rta_getattr_u16(tb[TCA_BPF_OPS_LEN]));
 
+       if (tb[TCA_BPF_TAG]) {
+               SPRINT_BUF(b);
+
+               fprintf(f, "tag %s ",
+                       hexstring_n2a(RTA_DATA(tb[TCA_BPF_TAG]),
+                                     RTA_PAYLOAD(tb[TCA_BPF_TAG]),
+                                     b, sizeof(b)));
+       }
+
        if (tb[TCA_BPF_POLICE]) {
                fprintf(f, "\n");
                tc_print_police(f, tb[TCA_BPF_POLICE]);
index f043ae48df7a87827ca4b28f30a7faee80ec2ebb..1ddc334f2f21b82628ccd7573f4eddc80f87dfc2 100644 (file)
@@ -177,6 +177,15 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
                fprintf(f, " ");
        }
 
+       if (tb[TCA_ACT_BPF_TAG]) {
+               SPRINT_BUF(b);
+
+               fprintf(f, "tag %s ",
+                       hexstring_n2a(RTA_DATA(tb[TCA_ACT_BPF_TAG]),
+                                     RTA_PAYLOAD(tb[TCA_ACT_BPF_TAG]),
+                                     b, sizeof(b)));
+       }
+
        fprintf(f, "default-action %s\n", action_n2a(parm->action));
        fprintf(f, "\tindex %u ref %d bind %d", parm->index, parm->refcnt,
                parm->bindcnt);