]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-monitor: Align builtin chain and table output
authorPhil Sutter <phil@nwl.cc>
Fri, 12 Jul 2024 11:37:12 +0000 (13:37 +0200)
committerPhil Sutter <phil@nwl.cc>
Sat, 27 Jul 2024 12:32:39 +0000 (14:32 +0200)
Drop the leading hash sign and add "NEW/DEL chain" annotation.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-monitor.c

index 90d1cc5e37f319d52f681930f43f97b0606f2ab9..e136e9b722e925518a469399e9bb09def7f73481 100644 (file)
@@ -153,7 +153,8 @@ static int chain_cb(const struct nlmsghdr *nlh, void *data)
                break;
        default:
                nftnl_chain_snprintf(buf, sizeof(buf), c, NFTNL_OUTPUT_DEFAULT, 0);
-               printf("# nft: %s\n", buf);
+               printf("nft: %s chain: %s\n",
+                      type == NFT_MSG_NEWCHAIN ? "NEW" : "DEL", buf);
                goto err_free;
        }