]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
lib/rt_names: Drop dead code in rtnl_rttable_n2a()
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Aug 2017 17:09:28 +0000 (19:09 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:12:21 +0000 (17:12 -0700)
Since 'id' is 32bit unsigned, it can never exceed RT_TABLE_MAX (which is
defined to 0xFFFFFFFF). Therefore drop that never matching conditional.

Signed-off-by: Phil Sutter <phil@nwl.cc>
lib/rt_names.c

index 04c15ff5b15f8cc4cd08c8d03e54bd2b30b1d68c..e5efd78e6f810da08dee60269d52a485d8e2cd3d 100644 (file)
@@ -410,10 +410,6 @@ const char *rtnl_rttable_n2a(__u32 id, char *buf, int len)
 {
        struct rtnl_hash_entry *entry;
 
-       if (id > RT_TABLE_MAX) {
-               snprintf(buf, len, "%u", id);
-               return buf;
-       }
        if (!rtnl_rttable_init)
                rtnl_rttable_initialize();
        entry = rtnl_rttable_hash[id & 255];