Blame SOURCES/libxt_recent-Remove-ineffective-checks-for-info-name.patch

9a3fa7
From 61fd4ee73f2a23eeb2b10b24d19ac13deaf0c177 Mon Sep 17 00:00:00 2001
9a3fa7
From: Phil Sutter <psutter@redhat.com>
9a3fa7
Date: Fri, 15 Mar 2019 17:51:28 +0100
9a3fa7
Subject: [PATCH] libxt_recent: Remove ineffective checks for info->name
9a3fa7
9a3fa7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1525980
9a3fa7
Upstream Status: iptables commit d0e3d95fa3442
9a3fa7
9a3fa7
commit d0e3d95fa3442c6ff32f7fed3e0d2eeb2248ef9f
9a3fa7
Author: Phil Sutter <phil@nwl.cc>
9a3fa7
Date:   Fri Oct 20 13:24:36 2017 +0200
9a3fa7
9a3fa7
    libxt_recent: Remove ineffective checks for info->name
9a3fa7
9a3fa7
    In struct xt_recent_mtinfo{,_v1}, field 'name' is an array, not a
9a3fa7
    pointer. So there is no point in comparing it against NULL. Changing the
9a3fa7
    check to make sure it's content is not an empty string is pointless
9a3fa7
    either, since a non-empty default string is used and the argument parser
9a3fa7
    will refuse empty strings as --name argument. So simply get rid of the
9a3fa7
    checks altogether.
9a3fa7
9a3fa7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
9a3fa7
    Signed-off-by: Florian Westphal <fw@strlen.de>
9a3fa7
9a3fa7
Signed-off-by: Phil Sutter <psutter@redhat.com>
9a3fa7
---
9a3fa7
 extensions/libxt_recent.c | 4 ++--
9a3fa7
 1 file changed, 2 insertions(+), 2 deletions(-)
9a3fa7
9a3fa7
diff --git a/extensions/libxt_recent.c b/extensions/libxt_recent.c
9a3fa7
index e1801f1c18952..055ae35080346 100644
9a3fa7
--- a/extensions/libxt_recent.c
9a3fa7
+++ b/extensions/libxt_recent.c
9a3fa7
@@ -199,7 +199,7 @@ static void recent_print(const void *ip, const struct xt_entry_match *match,
9a3fa7
 	if(info->hit_count) printf(" hit_count: %d", info->hit_count);
9a3fa7
 	if (info->check_set & XT_RECENT_TTL)
9a3fa7
 		printf(" TTL-Match");
9a3fa7
-	if(info->name) printf(" name: %s", info->name);
9a3fa7
+	printf(" name: %s", info->name);
9a3fa7
 	if (info->side == XT_RECENT_SOURCE)
9a3fa7
 		printf(" side: source");
9a3fa7
 	if (info->side == XT_RECENT_DEST)
9a3fa7
@@ -239,7 +239,7 @@ static void recent_save(const void *ip, const struct xt_entry_match *match,
9a3fa7
 	if(info->hit_count) printf(" --hitcount %d", info->hit_count);
9a3fa7
 	if (info->check_set & XT_RECENT_TTL)
9a3fa7
 		printf(" --rttl");
9a3fa7
-	if(info->name) printf(" --name %s",info->name);
9a3fa7
+	printf(" --name %s",info->name);
9a3fa7
 
9a3fa7
 	switch(family) {
9a3fa7
 	case NFPROTO_IPV4:
9a3fa7
-- 
9a3fa7
2.21.0
9a3fa7