From adb727afeb568404873e8cbc91ba93d3d49eff13 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 26 Dec 2022 14:07:48 +0000 Subject: gentoo auto-resync : 26:12:2022 - 14:07:48 --- ...-explicitly-pass-version-script-to-linker.patch | 27 --- .../files/nftables-1.0.2-compilation.patch | 36 --- ....map-export-new-nft_ctx_-get-set-_optimiz.patch | 31 --- ....4-revert-scanner-flags-move-to-own-scope.patch | 252 --------------------- 4 files changed, 346 deletions(-) delete mode 100644 net-firewall/nftables/files/nftables-1.0.2-build-explicitly-pass-version-script-to-linker.patch delete mode 100644 net-firewall/nftables/files/nftables-1.0.2-compilation.patch delete mode 100644 net-firewall/nftables/files/nftables-1.0.2-libnftables.map-export-new-nft_ctx_-get-set-_optimiz.patch delete mode 100644 net-firewall/nftables/files/nftables-1.0.4-revert-scanner-flags-move-to-own-scope.patch (limited to 'net-firewall/nftables/files') diff --git a/net-firewall/nftables/files/nftables-1.0.2-build-explicitly-pass-version-script-to-linker.patch b/net-firewall/nftables/files/nftables-1.0.2-build-explicitly-pass-version-script-to-linker.patch deleted file mode 100644 index 41c3de5bc83b..000000000000 --- a/net-firewall/nftables/files/nftables-1.0.2-build-explicitly-pass-version-script-to-linker.patch +++ /dev/null @@ -1,27 +0,0 @@ -https://git.netfilter.org/nftables/commit/src?id=1d507ce7f1d3c12481ee24bd1dcac2fc1984ee9f - -From: Sam James -Date: Thu, 24 Feb 2022 19:45:43 +0000 -Subject: build: explicitly pass --version-script to linker - ---version-script is a linker option, so let's use -Wl, so that -libtool handles it properly. It seems like the previous method gets silently -ignored with GNU libtool in some cases(?) and downstream in Gentoo, -we had to apply this change to make the build work with slibtool anyway. - -But it's indeed correct in any case, so let's swap. - -Signed-off-by: Sam James -Signed-off-by: Pablo Neira Ayuso ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -91,7 +91,7 @@ libparser_la_CFLAGS = ${AM_CFLAGS} \ - - libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} libparser.la - libnftables_la_LDFLAGS = -version-info ${libnftables_LIBVERSION} \ -- --version-script=$(srcdir)/libnftables.map -+ -Wl,--version-script=$(srcdir)/libnftables.map - - if BUILD_MINIGMP - noinst_LTLIBRARIES += libminigmp.la -cgit v1.2.3 diff --git a/net-firewall/nftables/files/nftables-1.0.2-compilation.patch b/net-firewall/nftables/files/nftables-1.0.2-compilation.patch deleted file mode 100644 index 96670c1d9531..000000000000 --- a/net-firewall/nftables/files/nftables-1.0.2-compilation.patch +++ /dev/null @@ -1,36 +0,0 @@ -https://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3 - -From 18a08fb7f0443f8bde83393bd6f69e23a04246b3 Mon Sep 17 00:00:00 2001 -From: Pablo Neira Ayuso -Date: Tue, 22 Feb 2022 00:56:36 +0100 -Subject: examples: compile with `make check' and add AM_CPPFLAGS - -Compile examples via `make check' like libnftnl does. Use AM_CPPFLAGS to -specify local headers via -I. - -Unfortunately, `make distcheck' did not catch this compile time error in -my system, since it was using the nftables/libnftables.h file of the -previous nftables release. - -Fixes: 5b364657a35f ("build: missing SUBIRS update") -Fixes: caf2a6ad2d22 ("examples: add libnftables example program") -Signed-off-by: Pablo Neira Ayuso ---- - examples/Makefile.am | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/examples/Makefile.am b/examples/Makefile.am -index c972170d..3b8b0b67 100644 ---- a/examples/Makefile.am -+++ b/examples/Makefile.am -@@ -1,4 +1,6 @@ --noinst_PROGRAMS = nft-buffer \ -+check_PROGRAMS = nft-buffer \ - nft-json-file - -+AM_CPPFLAGS = -I$(top_srcdir)/include -+ - LDADD = $(top_builddir)/src/libnftables.la --- -cgit v1.2.3 - diff --git a/net-firewall/nftables/files/nftables-1.0.2-libnftables.map-export-new-nft_ctx_-get-set-_optimiz.patch b/net-firewall/nftables/files/nftables-1.0.2-libnftables.map-export-new-nft_ctx_-get-set-_optimiz.patch deleted file mode 100644 index 09841d482222..000000000000 --- a/net-firewall/nftables/files/nftables-1.0.2-libnftables.map-export-new-nft_ctx_-get-set-_optimiz.patch +++ /dev/null @@ -1,31 +0,0 @@ -https://git.netfilter.org/nftables/commit/src?id=e98a9b83cd52c7c75bedb3dad46539b197ed17ba - -From: Sam James -Date: Thu, 24 Feb 2022 19:45:42 +0000 -Subject: libnftables.map: export new nft_ctx_{get,set}_optimize API - -[ Remove incorrect symbol names were exported via .map file ] - -Without this, we're not explicitly saying this is part of the -public API. - -This new API was added in 1.0.2 and is used by e.g. the main -nft binary. Noticed when fixing the version-script option -(separate patch) which picked up this problem when .map -was missing symbols (related to when symbol visibility -options get set). - -Signed-off-by: Sam James -Signed-off-by: Pablo Neira Ayuso ---- a/src/libnftables.map -+++ b/src/libnftables.map -@@ -30,6 +30,6 @@ LIBNFTABLES_2 { - } LIBNFTABLES_1; - - LIBNFTABLES_3 { -- nft_set_optimize; -- nft_get_optimize; -+ nft_ctx_set_optimize; -+ nft_ctx_get_optimize; - } LIBNFTABLES_2; -cgit v1.2.3 diff --git a/net-firewall/nftables/files/nftables-1.0.4-revert-scanner-flags-move-to-own-scope.patch b/net-firewall/nftables/files/nftables-1.0.4-revert-scanner-flags-move-to-own-scope.patch deleted file mode 100644 index db58602bb4e6..000000000000 --- a/net-firewall/nftables/files/nftables-1.0.4-revert-scanner-flags-move-to-own-scope.patch +++ /dev/null @@ -1,252 +0,0 @@ -From 638af0ceb2b22307098bb2730822e148ef0b9424 Mon Sep 17 00:00:00 2001 -From: Florian Westphal -Date: Fri, 10 Jun 2022 13:01:46 +0200 -Subject: Revert "scanner: flags: move to own scope" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Excess nesting of scanner scopes is very fragile and error prone: - -rule `iif != lo ip daddr 127.0.0.1/8 counter limit rate 1/second log flags all prefix "nft_lo4 " drop` -fails with `Error: No symbol type information` hinting at `prefix` - -Problem is that we nest via: - counter - limit - log - flags - -By the time 'prefix' is scanned, state is still stuck in 'counter' due -to this nesting. Working around "prefix" isn't enough, any other -keyword, e.g. "level" in 'flags all level debug' will be parsed as 'string' too. - -So, revert this. - -Fixes: a16697097e2b ("scanner: flags: move to own scope") -Reported-by: Christian Göttsche -Signed-off-by: Florian Westphal ---- - include/parser.h | 1 - - src/parser_bison.y | 29 ++++++++++++++--------------- - src/scanner.l | 18 +++++++----------- - tests/shell/testcases/parsing/log | 10 ++++++++++ - 4 files changed, 31 insertions(+), 27 deletions(-) - create mode 100755 tests/shell/testcases/parsing/log - -diff --git a/include/parser.h b/include/parser.h -index f32154cc..d8d2eb11 100644 ---- a/include/parser.h -+++ b/include/parser.h -@@ -35,7 +35,6 @@ enum startcond_type { - PARSER_SC_CT, - PARSER_SC_COUNTER, - PARSER_SC_ETH, -- PARSER_SC_FLAGS, - PARSER_SC_ICMP, - PARSER_SC_IGMP, - PARSER_SC_IP, -diff --git a/src/parser_bison.y b/src/parser_bison.y -index ca5c488c..2a0240fb 100644 ---- a/src/parser_bison.y -+++ b/src/parser_bison.y -@@ -942,7 +942,6 @@ close_scope_esp : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_ESP); } - close_scope_eth : { scanner_pop_start_cond(nft->scanner, PARSER_SC_ETH); }; - close_scope_export : { scanner_pop_start_cond(nft->scanner, PARSER_SC_CMD_EXPORT); }; - close_scope_fib : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_FIB); }; --close_scope_flags : { scanner_pop_start_cond(nft->scanner, PARSER_SC_FLAGS); }; - close_scope_frag : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_FRAG); }; - close_scope_fwd : { scanner_pop_start_cond(nft->scanner, PARSER_SC_STMT_FWD); }; - close_scope_hash : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_HASH); }; -@@ -1679,7 +1678,7 @@ table_block_alloc : /* empty */ - } - ; - --table_options : FLAGS STRING close_scope_flags -+table_options : FLAGS STRING - { - if (strcmp($2, "dormant") == 0) { - $0->flags |= TABLE_F_DORMANT; -@@ -1946,7 +1945,7 @@ set_block : /* empty */ { $$ = $-1; } - datatype_set($1->key, $3->dtype); - $$ = $1; - } -- | set_block FLAGS set_flag_list stmt_separator close_scope_flags -+ | set_block FLAGS set_flag_list stmt_separator - { - $1->flags = $3; - $$ = $1; -@@ -2080,7 +2079,7 @@ map_block : /* empty */ { $$ = $-1; } - $1->flags |= NFT_SET_OBJECT; - $$ = $1; - } -- | map_block FLAGS set_flag_list stmt_separator close_scope_flags -+ | map_block FLAGS set_flag_list stmt_separator - { - $1->flags |= $3; - $$ = $1; -@@ -2153,7 +2152,7 @@ flowtable_block : /* empty */ { $$ = $-1; } - { - $$->flags |= NFT_FLOWTABLE_COUNTER; - } -- | flowtable_block FLAGS OFFLOAD stmt_separator close_scope_flags -+ | flowtable_block FLAGS OFFLOAD stmt_separator - { - $$->flags |= FLOWTABLE_F_HW_OFFLOAD; - } -@@ -2520,7 +2519,7 @@ dev_spec : DEVICE string - | /* empty */ { $$ = NULL; } - ; - --flags_spec : FLAGS OFFLOAD close_scope_flags -+flags_spec : FLAGS OFFLOAD - { - $0->flags |= CHAIN_F_HW_OFFLOAD; - } -@@ -3126,7 +3125,7 @@ log_arg : PREFIX string - $0->log.level = $2; - $0->log.flags |= STMT_LOG_LEVEL; - } -- | FLAGS log_flags close_scope_flags -+ | FLAGS log_flags - { - $0->log.logflags |= $2; - } -@@ -3828,13 +3827,13 @@ queue_stmt : queue_stmt_compat close_scope_queue - { - $$ = queue_stmt_alloc(&@$, $3, 0); - } -- | QUEUE FLAGS queue_stmt_flags close_scope_flags TO queue_stmt_expr close_scope_queue -+ | QUEUE FLAGS queue_stmt_flags TO queue_stmt_expr close_scope_queue - { -- $$ = queue_stmt_alloc(&@$, $6, $3); -+ $$ = queue_stmt_alloc(&@$, $5, $3); - } -- | QUEUE FLAGS queue_stmt_flags close_scope_flags QUEUENUM queue_stmt_expr_simple close_scope_queue -+ | QUEUE FLAGS queue_stmt_flags QUEUENUM queue_stmt_expr_simple close_scope_queue - { -- $$ = queue_stmt_alloc(&@$, $6, $3); -+ $$ = queue_stmt_alloc(&@$, $5, $3); - } - ; - -@@ -5501,7 +5500,7 @@ comp_hdr_expr : COMP comp_hdr_field close_scope_comp - ; - - comp_hdr_field : NEXTHDR { $$ = COMPHDR_NEXTHDR; } -- | FLAGS close_scope_flags { $$ = COMPHDR_FLAGS; } -+ | FLAGS { $$ = COMPHDR_FLAGS; } - | CPI { $$ = COMPHDR_CPI; } - ; - -@@ -5562,7 +5561,7 @@ tcp_hdr_field : SPORT { $$ = TCPHDR_SPORT; } - | ACKSEQ { $$ = TCPHDR_ACKSEQ; } - | DOFF { $$ = TCPHDR_DOFF; } - | RESERVED { $$ = TCPHDR_RESERVED; } -- | FLAGS close_scope_flags { $$ = TCPHDR_FLAGS; } -+ | FLAGS { $$ = TCPHDR_FLAGS; } - | WINDOW { $$ = TCPHDR_WINDOW; } - | CHECKSUM { $$ = TCPHDR_CHECKSUM; } - | URGPTR { $$ = TCPHDR_URGPTR; } -@@ -5676,7 +5675,7 @@ sctp_chunk_type : DATA { $$ = SCTP_CHUNK_TYPE_DATA; } - ; - - sctp_chunk_common_field : TYPE close_scope_type { $$ = SCTP_CHUNK_COMMON_TYPE; } -- | FLAGS close_scope_flags { $$ = SCTP_CHUNK_COMMON_FLAGS; } -+ | FLAGS { $$ = SCTP_CHUNK_COMMON_FLAGS; } - | LENGTH { $$ = SCTP_CHUNK_COMMON_LENGTH; } - ; - -@@ -5844,7 +5843,7 @@ rt4_hdr_expr : RT4 rt4_hdr_field close_scope_rt - ; - - rt4_hdr_field : LAST_ENT { $$ = RT4HDR_LASTENT; } -- | FLAGS close_scope_flags { $$ = RT4HDR_FLAGS; } -+ | FLAGS { $$ = RT4HDR_FLAGS; } - | TAG { $$ = RT4HDR_TAG; } - | SID '[' NUM ']' - { -diff --git a/src/scanner.l b/src/scanner.l -index 2154281e..7eb74020 100644 ---- a/src/scanner.l -+++ b/src/scanner.l -@@ -201,7 +201,6 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - %s SCANSTATE_CT - %s SCANSTATE_COUNTER - %s SCANSTATE_ETH --%s SCANSTATE_FLAGS - %s SCANSTATE_ICMP - %s SCANSTATE_IGMP - %s SCANSTATE_IP -@@ -339,7 +338,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - "jump" { return JUMP; } - "goto" { return GOTO; } - "return" { return RETURN; } --"to" { return TO; } /* XXX: SCANSTATE_FLAGS and SCANSTATE_IP here are workarounds */ -+"to" { return TO; } /* XXX: SCANSTATE_IP is a workaround */ - - "inet" { return INET; } - "netdev" { return NETDEV; } -@@ -363,14 +362,9 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - "index" { return INDEX; } - "comment" { return COMMENT; } - --{ -- "constant" { return CONSTANT; } -- "dynamic" { return DYNAMIC; } -- -- /* log flags */ -- "all" { return ALL; } --} -+"constant" { return CONSTANT; } - "interval" { return INTERVAL; } -+"dynamic" { return DYNAMIC; } - "auto-merge" { return AUTOMERGE; } - "timeout" { return TIMEOUT; } - "gc-interval" { return GC_INTERVAL; } -@@ -418,7 +412,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - } - - "queue" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_QUEUE); return QUEUE;} --{ -+{ - "num" { return QUEUENUM;} - "bypass" { return BYPASS;} - "fanout" { return FANOUT;} -@@ -612,7 +606,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - { - "cpi" { return CPI; } - } --"flags" { scanner_push_start_cond(yyscanner, SCANSTATE_FLAGS); return FLAGS; } -+"flags" { return FLAGS; } - - "udp" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_UDP); return UDP; } - "udplite" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_UDPLITE); return UDPLITE; } -@@ -781,6 +775,8 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) - - "notrack" { return NOTRACK; } - -+"all" { return ALL; } -+ - { - "xml" { return XML; } - "json" { return JSON; } -diff --git a/tests/shell/testcases/parsing/log b/tests/shell/testcases/parsing/log -new file mode 100755 -index 00000000..0b89d589 ---- /dev/null -+++ b/tests/shell/testcases/parsing/log -@@ -0,0 +1,10 @@ -+#!/bin/bash -+ -+$NFT add table t || exit 1 -+$NFT add chain t c || exit 1 -+$NFT add rule t c 'iif != lo ip daddr 127.0.0.1/8 counter limit rate 1/second log flags all prefix "nft_lo4 " drop' || exit 1 -+$NFT add rule t c 'iif != lo ip daddr 127.0.0.1/8 counter limit rate 1/second log flags all level debug drop' || exit 1 -+$NFT delete table t || exit 1 -+ -+exit 0 -+ --- -cgit v1.2.3 - -- cgit v1.2.3