]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
exthdr: Add missing exthdr flags cases
authorPhil Sutter <phil@nwl.cc>
Thu, 16 Feb 2017 11:32:24 +0000 (12:32 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 16 Feb 2017 12:32:04 +0000 (13:32 +0100)
Looks like some chunks went by the board while merging with exthdr->op
patch.

Fixes: 4196376330468 ("exthdr: Add support for exthdr flags")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/expr/exthdr.c

index 143ad549ee1ea6588d0ffcf5359f1d44c7295173..c44c1a75a5ea95096c0369b87e006746237de463 100644 (file)
@@ -292,6 +292,8 @@ static int nftnl_expr_exthdr_export(char *buf, size_t len,
                nftnl_buf_u32(&b, type, exthdr->len, LEN);
        if (e->flags & (1 << NFTNL_EXPR_EXTHDR_OP))
                nftnl_buf_u32(&b, type, exthdr->op, OP);
+       if (e->flags & (1 << NFTNL_EXPR_EXTHDR_FLAGS))
+               nftnl_buf_u32(&b, type, exthdr->flags, FLAGS);
 
        return nftnl_buf_done(&b);
 }
@@ -338,6 +340,8 @@ static bool nftnl_expr_exthdr_cmp(const struct nftnl_expr *e1,
                eq &= (h1->type == h2->type);
        if (e1->flags & (1 << NFTNL_EXPR_EXTHDR_OP))
                eq &= (h1->op == h2->op);
+       if (e1->flags & (1 << NFTNL_EXPR_EXTHDR_FLAGS))
+               eq &= (h1->flags == h2->flags);
 
        return eq;
 }