path: root/src
diff options
authorFlorian Westphal <>2017-08-27 22:24:19 +0200
committerFlorian Westphal <>2017-08-28 17:56:58 +0200
commit071fa72b1db1ad897c19846720c3df40e9c4d574 (patch)
tree2564f1ed575d0d26a08e9aa62e6f1c04eabe1e87 /src
parent79c09386549472ecea72c60850ee33f7a4e49e9c (diff)
evaluate: convert expr_rt byteorder when evaluating statment arg
expr_rt might write data in host byte order, so make sure to convert if needed. This makes 'tcp option maxseg size rt mtu' actually work, right now such rules are no-ops because nft_exthdr never increases the mss. While at it, extend the example to not bother testing non-syn packets. Reported-by: Matteo Croce <> Signed-off-by: Florian Westphal <> Acked-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index f21ac1a0..9954d5c5 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1799,6 +1799,8 @@ static int stmt_evaluate_arg(struct eval_ctx *ctx, struct stmt *stmt,
return stmt_binary_error(ctx, *expr, stmt,
"you cannot reference a set here, "
"unknown value to use");
+ case EXPR_RT:
+ return byteorder_conversion(ctx, expr, byteorder);