summaryrefslogtreecommitdiffstats
path: root/src/exthdr.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-11-02 20:10:25 +0100
committerFlorian Westphal <fw@strlen.de>2020-11-09 12:19:31 +0100
commit881d8cb21c0b9168787b932f41b801593bde2216 (patch)
treeb5322deba14ab126822709b4a7691c6702d13f3a /src/exthdr.c
parent24d8da3083422da8336eeed2ee23b2ccf598ba5a (diff)
tcp: add raw tcp option match support
tcp option @42,16,4 (@kind,offset,length). Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/exthdr.c')
-rw-r--r--src/exthdr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/exthdr.c b/src/exthdr.c
index 8995ad17..5eb66529 100644
--- a/src/exthdr.c
+++ b/src/exthdr.c
@@ -52,10 +52,15 @@ static void exthdr_expr_print(const struct expr *expr, struct output_ctx *octx)
*/
unsigned int offset = expr->exthdr.offset / 64;
- if (expr->exthdr.desc == NULL &&
- expr->exthdr.offset == 0 &&
- expr->exthdr.flags & NFT_EXTHDR_F_PRESENT) {
- nft_print(octx, "tcp option %d", expr->exthdr.raw_type);
+ if (expr->exthdr.desc == NULL) {
+ if (expr->exthdr.offset == 0 &&
+ expr->exthdr.flags & NFT_EXTHDR_F_PRESENT) {
+ nft_print(octx, "tcp option %d", expr->exthdr.raw_type);
+ return;
+ }
+
+ nft_print(octx, "tcp option @%u,%u,%u", expr->exthdr.raw_type,
+ expr->exthdr.offset, expr->len);
return;
}