naccyde / rpms / iproute

Forked from rpms/iproute 7 months ago
Clone

Blame SOURCES/0064-lib-make-resolve_hosts-variable-common.patch

36cfb7
From c74a0bcb2e9c88b2ee166afc08574141a6a288b8 Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 25 Mar 2019 13:30:43 +0100
36cfb7
Subject: [PATCH] lib: make resolve_hosts variable common
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1642479
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1641914
36cfb7
Upstream Status: iproute2.git commit 6648853975332
36cfb7
36cfb7
commit 6648853975332e5f34d03a1e2a6e09f5e1742099
36cfb7
Author: Ivan Vecera <ivecera@redhat.com>
36cfb7
Date:   Fri Nov 10 07:20:13 2017 +0100
36cfb7
36cfb7
    lib: make resolve_hosts variable common
36cfb7
36cfb7
    Any iproute utility that uses any function from lib/utils.c needs
36cfb7
    to declare its own resolve_hosts variable instance although it does
36cfb7
    not need/use hostname resolving functionality (currently only 'ip'
36cfb7
    and 'ss' commands uses this).
36cfb7
    The patch declares single common instance of resolve_hosts directly
36cfb7
    in utils.c so the existing ones can be removed (the same approach
36cfb7
    that is used for timestamp_short).
36cfb7
36cfb7
    Cc: Jiri Pirko <jiri@mellanox.com>
36cfb7
    Cc: Arkadi Sharshevsky <arkadis@mellanox.com>
36cfb7
    Signed-off-by: Ivan Vecera <ivecera@redhat.com>
36cfb7
---
36cfb7
 bridge/bridge.c | 1 -
36cfb7
 genl/genl.c     | 1 -
36cfb7
 ip/ip.c         | 1 -
36cfb7
 ip/rtmon.c      | 1 -
36cfb7
 lib/utils.c     | 1 +
36cfb7
 misc/arpd.c     | 2 --
36cfb7
 misc/ss.c       | 1 -
36cfb7
 tc/tc.c         | 1 -
36cfb7
 8 files changed, 1 insertion(+), 8 deletions(-)
36cfb7
36cfb7
diff --git a/bridge/bridge.c b/bridge/bridge.c
36cfb7
index 5ff038d672ad2..6658cb8fd801d 100644
36cfb7
--- a/bridge/bridge.c
36cfb7
+++ b/bridge/bridge.c
36cfb7
@@ -18,7 +18,6 @@
36cfb7
 
36cfb7
 struct rtnl_handle rth = { .fd = -1 };
36cfb7
 int preferred_family = AF_UNSPEC;
36cfb7
-int resolve_hosts;
36cfb7
 int oneline;
36cfb7
 int show_stats;
36cfb7
 int show_details;
36cfb7
diff --git a/genl/genl.c b/genl/genl.c
36cfb7
index 747074b029a7b..7e4a208d449f2 100644
36cfb7
--- a/genl/genl.c
36cfb7
+++ b/genl/genl.c
36cfb7
@@ -30,7 +30,6 @@
36cfb7
 int show_stats = 0;
36cfb7
 int show_details = 0;
36cfb7
 int show_raw = 0;
36cfb7
-int resolve_hosts = 0;
36cfb7
 
36cfb7
 static void *BODY;
36cfb7
 static struct genl_util * genl_list;
36cfb7
diff --git a/ip/ip.c b/ip/ip.c
36cfb7
index 07050b07592ac..0c0ad1bde7cb6 100644
36cfb7
--- a/ip/ip.c
36cfb7
+++ b/ip/ip.c
36cfb7
@@ -30,7 +30,6 @@ int human_readable;
36cfb7
 int use_iec;
36cfb7
 int show_stats;
36cfb7
 int show_details;
36cfb7
-int resolve_hosts;
36cfb7
 int oneline;
36cfb7
 int brief;
36cfb7
 int timestamp;
36cfb7
diff --git a/ip/rtmon.c b/ip/rtmon.c
36cfb7
index 1c2981f79d3d1..94baa38e3b7cb 100644
36cfb7
--- a/ip/rtmon.c
36cfb7
+++ b/ip/rtmon.c
36cfb7
@@ -25,7 +25,6 @@
36cfb7
 #include "utils.h"
36cfb7
 #include "libnetlink.h"
36cfb7
 
36cfb7
-int resolve_hosts;
36cfb7
 static int init_phase = 1;
36cfb7
 
36cfb7
 static void write_stamp(FILE *fp)
36cfb7
diff --git a/lib/utils.c b/lib/utils.c
36cfb7
index 9f55391d3c1ea..fc9c575ba0c7d 100644
36cfb7
--- a/lib/utils.c
36cfb7
+++ b/lib/utils.c
36cfb7
@@ -35,6 +35,7 @@
36cfb7
 #include "utils.h"
36cfb7
 #include "namespace.h"
36cfb7
 
36cfb7
+int resolve_hosts;
36cfb7
 int timestamp_short;
36cfb7
 
36cfb7
 int get_hex(char c)
36cfb7
diff --git a/misc/arpd.c b/misc/arpd.c
36cfb7
index bfab44544ee1d..c9d86475e5995 100644
36cfb7
--- a/misc/arpd.c
36cfb7
+++ b/misc/arpd.c
36cfb7
@@ -38,8 +38,6 @@
36cfb7
 #include "utils.h"
36cfb7
 #include "rt_names.h"
36cfb7
 
36cfb7
-int resolve_hosts;
36cfb7
-
36cfb7
 DB	*dbase;
36cfb7
 char	*dbname = "/var/lib/arpd/arpd.db";
36cfb7
 
36cfb7
diff --git a/misc/ss.c b/misc/ss.c
36cfb7
index e92266539e6b5..c0cb33e96d9ec 100644
36cfb7
--- a/misc/ss.c
36cfb7
+++ b/misc/ss.c
36cfb7
@@ -89,7 +89,6 @@ static int security_get_initial_context(char *name,  char **context)
36cfb7
 }
36cfb7
 #endif
36cfb7
 
36cfb7
-int resolve_hosts;
36cfb7
 int resolve_services = 1;
36cfb7
 int preferred_family = AF_UNSPEC;
36cfb7
 int show_options;
36cfb7
diff --git a/tc/tc.c b/tc/tc.c
36cfb7
index 360c9f11c235b..11a364fabbbea 100644
36cfb7
--- a/tc/tc.c
36cfb7
+++ b/tc/tc.c
36cfb7
@@ -39,7 +39,6 @@ int show_graph;
36cfb7
 int timestamp;
36cfb7
 
36cfb7
 int batch_mode;
36cfb7
-int resolve_hosts;
36cfb7
 int use_iec;
36cfb7
 int force;
36cfb7
 int ok;
36cfb7
-- 
e138d9
2.21.0
36cfb7