naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

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

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