]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
lib: make resolve_hosts variable common
authorIvan Vecera <ivecera@redhat.com>
Fri, 10 Nov 2017 06:20:13 +0000 (07:20 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 13 Nov 2017 00:15:23 +0000 (16:15 -0800)
Any iproute utility that uses any function from lib/utils.c needs
to declare its own resolve_hosts variable instance although it does
not need/use hostname resolving functionality (currently only 'ip'
and 'ss' commands uses this).
The patch declares single common instance of resolve_hosts directly
in utils.c so the existing ones can be removed (the same approach
that is used for timestamp_short).

Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
bridge/bridge.c
genl/genl.c
ip/ip.c
ip/rtmon.c
lib/utils.c
misc/arpd.c
misc/ss.c
tc/tc.c

index 5ff038d672ad26459f2f8992898e8589bcff0e65..6658cb8fd801d68a6f4990f7c9544fef860dda9e 100644 (file)
@@ -18,7 +18,6 @@
 
 struct rtnl_handle rth = { .fd = -1 };
 int preferred_family = AF_UNSPEC;
-int resolve_hosts;
 int oneline;
 int show_stats;
 int show_details;
index 747074b029a7b98626ba32b70e15dc2e3b7aded9..7e4a208d449f2fea370eda616fc836539851b1ab 100644 (file)
@@ -30,7 +30,6 @@
 int show_stats = 0;
 int show_details = 0;
 int show_raw = 0;
-int resolve_hosts = 0;
 
 static void *BODY;
 static struct genl_util * genl_list;
diff --git a/ip/ip.c b/ip/ip.c
index e66f69700105e82eb55a469b037aaf1107e15c42..e2da46dd83f304b1116565d4509ff9d47ffdcc14 100644 (file)
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -30,7 +30,6 @@ int human_readable;
 int use_iec;
 int show_stats;
 int show_details;
-int resolve_hosts;
 int oneline;
 int brief;
 int json;
index 1c2981f79d3d1d4b7c5dfb93b56bee6bedba8d2c..94baa38e3b7cbc16d042e31ca40a3c2c91f1c819 100644 (file)
@@ -25,7 +25,6 @@
 #include "utils.h"
 #include "libnetlink.h"
 
-int resolve_hosts;
 static int init_phase = 1;
 
 static void write_stamp(FILE *fp)
index ac155bf5a0447a60a2075a625c24b89405f2e6b0..f77be1fda944fcc4d26ebe8a2ffb350b4e0743dd 100644 (file)
@@ -37,6 +37,7 @@
 #include "utils.h"
 #include "namespace.h"
 
+int resolve_hosts;
 int timestamp_short;
 
 int get_hex(char c)
index c2666f76fd5e935a860479ac08ac8c1cd7550aa8..67d86b67957b8a308c5b7db006745ab9a1f436f5 100644 (file)
@@ -38,8 +38,6 @@
 #include "utils.h"
 #include "rt_names.h"
 
-int resolve_hosts;
-
 DB     *dbase;
 char   *dbname = "/var/lib/arpd/arpd.db";
 
index 56a9ad415ce1cc3460ce55e2339dd4f0b74b9e2f..45a0c330ec55f424fe02d1c2c6d84a0aa91974ed 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -88,7 +88,6 @@ static int security_get_initial_context(char *name,  char **context)
 }
 #endif
 
-int resolve_hosts;
 int resolve_services = 1;
 int preferred_family = AF_UNSPEC;
 int show_options;
diff --git a/tc/tc.c b/tc/tc.c
index 8e64a82b4271cf1800c2feabb24a28c31b765382..32924164df36f0fdf1aeb8bad84146da10db1309 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -39,7 +39,6 @@ int show_graph;
 int timestamp;
 
 int batch_mode;
-int resolve_hosts;
 int use_iec;
 int force;
 bool use_names;