From 6ab0fd6c67dbccedb49209b94eb7f740dd32fd2a Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Tue, 11 Apr 2023 21:45:34 +0100 Subject: exthdr: add boolean DCCP option matching Iptables supports the matching of DCCP packets based on the presence or absence of DCCP options. Extend exthdr expressions to add this functionality to nftables. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=930 Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 90a2b9c3..763c1b2d 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -5968,6 +5968,15 @@ dccp_hdr_expr : DCCP dccp_hdr_field close_scope_dccp { $$ = payload_expr_alloc(&@$, &proto_dccp, $2); } + | DCCP OPTION NUM close_scope_dccp + { + if ($3 > DCCPOPT_TYPE_MAX) { + erec_queue(error(&@1, "value too large"), + state->msgs); + YYERROR; + } + $$ = dccpopt_expr_alloc(&@$, $3); + } ; dccp_hdr_field : SPORT { $$ = DCCPHDR_SPORT; } -- cgit v1.2.3