summaryrefslogtreecommitdiffstats
path: root/src/tcpopt.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-03-10 18:13:50 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-03-10 19:01:21 +0100
commit627be570eff8f05849614a257e6fa45c744f4dbd (patch)
treebf434417d7d862ab4ee74cb7f330729fa84149fc /src/tcpopt.c
parent9fd9baba43c8ee17f944a1157b77a8e47cb9ba41 (diff)
exthdr: Add support for exthdr specific flags
This allows to have custom flags in exthdr expression, which is necessary for upcoming existence checks (of both IPv6 extension headers as well as TCP options). Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/tcpopt.c')
-rw-r--r--src/tcpopt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tcpopt.c b/src/tcpopt.c
index f8612141..d34dfd45 100644
--- a/src/tcpopt.c
+++ b/src/tcpopt.c
@@ -192,7 +192,7 @@ struct expr *tcpopt_expr_alloc(const struct location *loc, uint8_t type,
}
void tcpopt_init_raw(struct expr *expr, uint8_t type, unsigned int offset,
- unsigned int len)
+ unsigned int len, uint32_t flags)
{
const struct proto_hdr_template *tmpl;
unsigned int i, off;
@@ -200,6 +200,7 @@ void tcpopt_init_raw(struct expr *expr, uint8_t type, unsigned int offset,
assert(expr->ops->type == EXPR_EXTHDR);
expr->len = len;
+ expr->exthdr.flags = flags;
expr->exthdr.offset = offset;
assert(type < array_size(tcpopt_protocols));
@@ -229,7 +230,7 @@ bool tcpopt_find_template(struct expr *expr, const struct expr *mask,
return false;
tcpopt_init_raw(expr, expr->exthdr.desc->type, expr->exthdr.offset,
- expr->len);
+ expr->len, 0);
if (expr->exthdr.tmpl == &tcpopt_unknown_template)
return false;