[iptables] iptables: fix printing of line numbers with --line-numbers arg

Patrick McHardy netfilter-cvslog-bounces at lists.netfilter.org
Fri Jun 13 18:11:21 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=1564189568fb63292c7f586563d4fda430a40de3
commit 1564189568fb63292c7f586563d4fda430a40de3
Author:     Henrik Nordstrom <henrik at henriknordstrom.net>
AuthorDate: Fri Jun 13 17:57:35 2008 +0200
Commit:     Patrick McHardy <kaber at trash.net>
CommitDate: Fri Jun 13 17:57:35 2008 +0200

    iptables: fix printing of line numbers with --line-numbers arg
    
    Commit bb34082d ("iptables --list chain rulenum") broke the line
    numbering, starting with printing an offset of 2.
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>
       via  1564189568fb63292c7f586563d4fda430a40de3 (commit)
      from  e145621e88ef65d2c1f34f9225c4c0cb7e52516d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1564189568fb63292c7f586563d4fda430a40de3
Author: Henrik Nordstrom <henrik at henriknordstrom.net>
Date:   Fri Jun 13 17:57:35 2008 +0200

    iptables: fix printing of line numbers with --line-numbers arg
    
    Commit bb34082d ("iptables --list chain rulenum") broke the line
    numbering, starting with printing an offset of 2.
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

-----------------------------------------------------------------------

 ip6tables.c |    2 +-
 iptables.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Commit bb34082d ("iptables --list chain rulenum") broke the line
numbering, starting with printing an offset of 2.

Signed-off-by: Patrick McHardy <kaber at trash.net>

diff --git a/ip6tables.c b/ip6tables.c
index 8e135f1..e146114 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -737,7 +737,7 @@ print_firewall(const struct ip6t_entry *fw,
 	flags = fw->ipv6.flags;
 
 	if (format & FMT_LINENUMBERS)
-		printf(FMT("%-4u ", "%u "), num+1);
+		printf(FMT("%-4u ", "%u "), num);
 
 	if (!(format & FMT_NOCOUNTS)) {
 		print_num(fw->counters.pcnt, format);
diff --git a/iptables.c b/iptables.c
index cff8cf4..bf3cbca 100644
--- a/iptables.c
+++ b/iptables.c
@@ -737,7 +737,7 @@ print_firewall(const struct ipt_entry *fw,
 	flags = fw->ip.flags;
 
 	if (format & FMT_LINENUMBERS)
-		printf(FMT("%-4u ", "%u "), num+1);
+		printf(FMT("%-4u ", "%u "), num);
 
 	if (!(format & FMT_NOCOUNTS)) {
 		print_num(fw->counters.pcnt, format);



More information about the netfilter-cvslog mailing list