]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
expr: exthdr: Display NFT_EXTHDR_F_PRESENT in debug output
authorPhil Sutter <phil@nwl.cc>
Sat, 11 Mar 2017 13:27:23 +0000 (14:27 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 13 Mar 2017 11:13:07 +0000 (12:13 +0100)
This allows to assert it in testsuite also.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/expr/exthdr.c

index 9ed4ae1725ac1c06945e75733b09629f6f495467..d4f166525dc9eefe44bdb400df65eece70c66152 100644 (file)
@@ -301,9 +301,11 @@ static int nftnl_expr_exthdr_snprintf_default(char *buf, size_t len,
                                              const struct nftnl_expr *e)
 {
        struct nftnl_expr_exthdr *exthdr = nftnl_expr_data(e);
-       return snprintf(buf, len, "load%s %ub @ %u + %u => reg %u ",
+       return snprintf(buf, len, "load%s %ub @ %u + %u%s => reg %u ",
                        op2str(exthdr->op), exthdr->len, exthdr->type,
-                       exthdr->offset, exthdr->dreg);
+                       exthdr->offset,
+                       exthdr->flags & NFT_EXTHDR_F_PRESENT ? " present" : "",
+                       exthdr->dreg);
 }
 
 static int