Blame SOURCES/0087-lib-rt_names-Drop-dead-code-in-rtnl_rttable_n2a.patch

99be8f
From cd4f6a9976a969d4981b3b3d09b60ed311f3e9a5 Mon Sep 17 00:00:00 2001
99be8f
From: Andrea Claudi <aclaudi@redhat.com>
99be8f
Date: Mon, 29 Apr 2019 20:07:22 +0200
99be8f
Subject: [PATCH] lib/rt_names: Drop dead code in rtnl_rttable_n2a()
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
99be8f
Upstream Status: iproute2.git commit b3c5f84493d33
99be8f
99be8f
commit b3c5f84493d3399a546566475203207aa5b64d54
99be8f
Author: Phil Sutter <phil@nwl.cc>
99be8f
Date:   Thu Aug 17 19:09:28 2017 +0200
99be8f
99be8f
    lib/rt_names: Drop dead code in rtnl_rttable_n2a()
99be8f
99be8f
    Since 'id' is 32bit unsigned, it can never exceed RT_TABLE_MAX (which is
99be8f
    defined to 0xFFFFFFFF). Therefore drop that never matching conditional.
99be8f
99be8f
    Signed-off-by: Phil Sutter <phil@nwl.cc>
99be8f
---
99be8f
 lib/rt_names.c | 4 ----
99be8f
 1 file changed, 4 deletions(-)
99be8f
99be8f
diff --git a/lib/rt_names.c b/lib/rt_names.c
99be8f
index 04c15ff5b15f8..e5efd78e6f810 100644
99be8f
--- a/lib/rt_names.c
99be8f
+++ b/lib/rt_names.c
99be8f
@@ -410,10 +410,6 @@ const char *rtnl_rttable_n2a(__u32 id, char *buf, int len)
99be8f
 {
99be8f
 	struct rtnl_hash_entry *entry;
99be8f
 
99be8f
-	if (id > RT_TABLE_MAX) {
99be8f
-		snprintf(buf, len, "%u", id);
99be8f
-		return buf;
99be8f
-	}
99be8f
 	if (!rtnl_rttable_init)
99be8f
 		rtnl_rttable_initialize();
99be8f
 	entry = rtnl_rttable_hash[id & 255];
99be8f
-- 
d30c09
2.21.0
99be8f