From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Cc: Erik Skultety <eskultet@redhat.com>, Florian Westphal <fw@strlen.de>
Subject: [iptables PATCH 2/3] xshared: Fix for missing space after 'prot' column
Date: Thu, 28 Jul 2022 13:31:35 +0200 [thread overview]
Message-ID: <20220728113136.24376-2-phil@nwl.cc> (raw)
In-Reply-To: <20220728113136.24376-1-phil@nwl.cc>
Format string ensured a minimum field width of five characters, but
allowed for longer strings to eat the column delimiting white space.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
.../tests/shell/testcases/ip6tables/0002-verbose-output_0 | 2 +-
iptables/xshared.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/iptables/tests/shell/testcases/ip6tables/0002-verbose-output_0 b/iptables/tests/shell/testcases/ip6tables/0002-verbose-output_0
index 4e754156ba589..dad01a982a915 100755
--- a/iptables/tests/shell/testcases/ip6tables/0002-verbose-output_0
+++ b/iptables/tests/shell/testcases/ip6tables/0002-verbose-output_0
@@ -35,7 +35,7 @@ Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth2 eth3 feed:babe::1 feed:babe::2
0 0 ACCEPT all -- eth2 eth3 feed:babe::4 feed:babe::5
- 0 0 ipv6-icmp-- * * ::/0 ::/0 ipv6-icmptype 1 code 0
+ 0 0 ipv6-icmp -- * * ::/0 ::/0 ipv6-icmptype 1 code 0
0 0 all -- * * ::/0 ::/0 dst length:42 rt type:23
0 0 LOG all -- * * ::/0 ::/0 frag id:1337 LOG flags 0 level 4
diff --git a/iptables/xshared.c b/iptables/xshared.c
index b1088c8234426..ccec4ff1bceef 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -1093,9 +1093,9 @@ void print_rule_details(unsigned int linenum, const struct xt_counters *ctrs,
fputc(invflags & XT_INV_PROTO ? '!' : ' ', stdout);
if (pname)
- printf(FMT("%-5s", "%s "), pname);
+ printf(FMT("%-4s ", "%s "), pname);
else
- printf(FMT("%-5hu", "%hu "), proto);
+ printf(FMT("%-4hu ", "%hu "), proto);
}
void save_rule_details(const char *iniface, unsigned const char *iniface_mask,
--
2.34.1
next prev parent reply other threads:[~2022-07-28 11:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 11:31 [iptables PATCH 1/3] tests: shell: Fix testcases for changed ip6tables opts output Phil Sutter
2022-07-28 11:31 ` Phil Sutter [this message]
2022-07-28 11:31 ` [iptables PATCH 3/3] xshared: Print protocol numbers if --numeric was given Phil Sutter
2022-07-28 13:26 ` [iptables PATCH 1/3] tests: shell: Fix testcases for changed ip6tables opts output Florian Westphal
2022-07-29 9:54 ` Phil Sutter
2022-07-29 13:07 ` Erik Skultety
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728113136.24376-2-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=eskultet@redhat.com \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.