!147 Revert fix correct the -n args show dismatch

From: @yangl777 
Reviewed-by: @sunsuwan 
Signed-off-by: @sunsuwan
This commit is contained in:
openeuler-ci-bot 2024-12-16 09:11:41 +00:00 committed by Gitee
commit bc31c6d2a8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 11 additions and 33 deletions

View File

@ -1,31 +0,0 @@
From b6f9c55a301654891288ef11358290ce67519930 Mon Sep 17 00:00:00 2001
From: renwang <renwang@uniontech.com>
Date: Tue, 3 Dec 2024 15:55:57 +0800
Subject: [PATCH] second
---
iptables/iptables.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/iptables/iptables.c b/iptables/iptables.c
index 88ef6cf..fba69a9 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -478,10 +478,10 @@ print_firewall(const struct ipt_entry *fw,
fputc(fw->ip.invflags & XT_INV_PROTO ? '!' : ' ', stdout);
{
const char *pname = proto_to_name(fw->ip.proto, format&FMT_NUMERIC);
- if (pname)
- printf(FMT("%-5s", "%s "), pname);
- else
- printf(FMT("%-5hu", "%hu "), fw->ip.proto);
+ if (((format & (FMT_NUMERIC | FMT_NOTABLE)) == FMT_NUMERIC) || !pname)
+ printf(FMT("%-4hu ", "%hu "),fw->ip.proto);
+ else
+ printf(FMT("%-4s ", "%s "), pname);
}
if (format & FMT_OPTIONS) {
--
2.20.1

View File

@ -2,7 +2,7 @@
%global legacy_actions %{_libexecdir}/initscripts/legacy-actions
Name: iptables
Version: 1.8.5
Release: 9
Release: 10
Summary: IP packet filter administration utilities
License: GPL-2.0-only and Artistic-2.0
URL: https://www.netfilter.org/
@ -21,7 +21,6 @@ Patch6005: backport-libxtables-Register-multiple-extensions-in-ascending-
Patch6006: backport-libxtables-Simplify-pending-extension-registration.patch
Patch6007: backport-libxtables-Register-only-the-highest-revision-extension.patch
Patch6008: enabled-makecheck-in-extensions.patch
Patch6009: backport-iptables-Fix-n-args-show-dismatch.patch
BuildRequires: bison flex gcc kernel-headers libpcap-devel libselinux-devel systemd git
BuildRequires: libmnl-devel libnetfilter_conntrack-devel libnfnetlink-devel libnftnl-devel
@ -324,7 +323,17 @@ fi
%{_mandir}/man8/xtables-legacy*
%changelog
* Mon Dec 16 2024 yanglu <yanglu72@h-partners.com> - 1.8.5-10
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Revert fix correct the -n args show dismatch
* Wed Dec 04 2024 renwang <renwang@uniontech.com> - 1.8.5-9
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix correct the -n args show dismatch
* Mon Sep 30 2024 zhouyihang <zhouyihang3@h-partners.com> - 1.8.5-8
- Type:bugfix