]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
Revert "monitor: do not print generation ID with --echo"
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 22 Oct 2020 20:34:17 +0000 (22:34 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 23 Oct 2020 12:26:05 +0000 (14:26 +0200)
Revert 0e258556f7f3 ("monitor: do not print generation ID with --echo").

There is actually a kernel bug which is preventing from displaying
this generation ID message.

Update the tests/shell to remove the last line of the --echo output
which displays the generation ID once the "netfilter: nftables: fix netlink
report logic in flowtable and genid" kernel fix is applied.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/monitor.c
tests/shell/testcases/sets/0036add_set_element_expiration_0

index 9e508f8f757432a56107df29bc0d652523fd2cd6..3872ebcfbdaf649febc10cfba4f5b910e45d2425 100644 (file)
@@ -849,7 +849,7 @@ static int netlink_events_newgen_cb(const struct nlmsghdr *nlh, int type,
                        break;
                }
        }
-       if (!nft_output_echo(&monh->ctx->nft->output) && genid >= 0) {
+       if (genid >= 0) {
                nft_mon_print(monh, "# new generation %d", genid);
                if (pid >= 0)
                        nft_mon_print(monh, " by process %d (%s)", pid, name);
index 51ed0f2c1b3e833d22cbc3eda162e0b86122cf21..7b2e39a3f0406332d41c294c8c8ae67bba3cfa43 100755 (executable)
@@ -6,7 +6,7 @@ RULESET="add table ip x
 add set ip x y { type ipv4_addr; flags dynamic,timeout; } 
 add element ip x y { 1.1.1.1 timeout 30s expires 15s }"
 
-test_output=$($NFT -e -f - <<< "$RULESET" 2>&1)
+test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1)
 
 if [ "$test_output" != "$RULESET" ] ; then
        $DIFF -u <(echo "$test_output") <(echo "$RULESET")