summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-07-05 00:54:27 +0200
committerFlorian Westphal <fw@strlen.de>2017-08-22 23:51:08 +0200
commit444ac7bee1452cdf59ec44400db210423052d109 (patch)
tree3b9d1b9952b78652e4b9342cb037899acf87a258 /src
parent0c0b2452bc3c96cf3db09eb8cbf62778a2fd8f6c (diff)
rt: add path mtu support
Only use case is to allow similar behaviour to iptables TCPMSS --clamp-mss-to-pmtu, by combining this with exthdr statement: tcp option maxseg size set rt mtu Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/parser_bison.y1
-rw-r--r--src/rt.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 7898ea3f..18be53e8 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -3094,6 +3094,7 @@ rt_expr : RT rt_key
rt_key : CLASSID { $$ = NFT_RT_CLASSID; }
| NEXTHOP { $$ = NFT_RT_NEXTHOP4; }
+ | MTU { $$ = NFT_RT_TCPMSS; }
;
ct_expr : CT ct_key
diff --git a/src/rt.c b/src/rt.c
index cd2d5a4e..91be5a11 100644
--- a/src/rt.c
+++ b/src/rt.c
@@ -73,6 +73,11 @@ static const struct rt_template rt_templates[] = {
16 * BITS_PER_BYTE,
BYTEORDER_BIG_ENDIAN,
true),
+ [NFT_RT_TCPMSS] = RT_TEMPLATE("mtu",
+ &integer_type,
+ 2 * BITS_PER_BYTE,
+ BYTEORDER_HOST_ENDIAN,
+ false),
};
static void rt_expr_print(const struct expr *expr, struct output_ctx *octx)