naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone
Blob Blame History Raw
From f416b73a7f47494cf6d18cdaad5e86709bc43a63 Mon Sep 17 00:00:00 2001
From: Andrea Claudi <aclaudi@redhat.com>
Date: Thu, 13 Jun 2019 14:37:57 +0200
Subject: [PATCH] Include bsd/string.h only in include/utils.h

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1716361
Upstream Status: iproute2.git commit 6d2fd4a53f63b

commit 6d2fd4a53f63bd20667b1a8f2ec8fde1fc3a54d4
Author: Luca Boccassi <bluca@debian.org>
Date:   Thu Nov 1 22:25:27 2018 +0000

    Include bsd/string.h only in include/utils.h

    This is simpler and cleaner, and avoids having to include the header
    from every file where the functions are used. The prototypes of the
    internal implementation are in this header, so utils.h will have to be
    included anyway for those.

    Fixes: 508f3c231efb ("Use libbsd for strlcpy if available")

    Signed-off-by: Luca Boccassi <bluca@debian.org>
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 genl/ctrl.c           | 3 ---
 include/utils.h       | 4 ++++
 ip/iplink.c           | 3 ---
 ip/ipnetns.c          | 3 ---
 ip/iproute_lwtunnel.c | 3 ---
 ip/ipvrf.c            | 3 ---
 ip/ipxfrm.c           | 3 ---
 ip/tunnel.c           | 3 ---
 ip/xfrm_state.c       | 3 ---
 lib/bpf.c             | 3 ---
 lib/fs.c              | 3 ---
 lib/inet_proto.c      | 3 ---
 misc/ss.c             | 3 ---
 tc/em_ipset.c         | 3 ---
 tc/m_pedit.c          | 3 ---
 15 files changed, 4 insertions(+), 42 deletions(-)

diff --git a/genl/ctrl.c b/genl/ctrl.c
index 4063ec0ba474b..0d9c5f2517b78 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -18,9 +18,6 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 
 #include "utils.h"
 #include "genl_utils.h"
diff --git a/include/utils.h b/include/utils.h
index 8cb4349e8a89f..c32b37a1797d8 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -9,6 +9,10 @@
 #include <stdbool.h>
 #include <time.h>
 
+#ifdef HAVE_LIBBSD
+#include <bsd/string.h>
+#endif
+
 #include "libnetlink.h"
 #include "ll_map.h"
 #include "rtm_map.h"
diff --git a/ip/iplink.c b/ip/iplink.c
index 2f8f3bf1f84bb..0ba5f1af76697 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -24,9 +24,6 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <sys/ioctl.h>
 #include <stdbool.h>
 #include <linux/mpls.h>
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 5991592e947b6..368be0cbc0a48 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -8,9 +8,6 @@
 #include <sys/syscall.h>
 #include <stdio.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <sched.h>
 #include <fcntl.h>
 #include <dirent.h>
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index be9f60c3b2137..388cd19a3ef0b 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -16,9 +16,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <linux/ila.h>
 #include <linux/lwtunnel.h>
 #include <linux/mpls_iptunnel.h>
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 8572b4f23e3dc..8a6b7f977b142 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -21,9 +21,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <dirent.h>
 #include <errno.h>
 #include <limits.h>
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 5304dfc1af906..12c2f721571b6 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -28,9 +28,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <time.h>
diff --git a/ip/tunnel.c b/ip/tunnel.c
index d54505d483d22..79de7f2406f0e 100644
--- a/ip/tunnel.c
+++ b/ip/tunnel.c
@@ -24,9 +24,6 @@
 
 #include <stdio.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <unistd.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index 0c8df7e6e10cd..85d959cc4f44f 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -27,9 +27,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <netdb.h>
 #include "utils.h"
 #include "xfrm.h"
diff --git a/lib/bpf.c b/lib/bpf.c
index 35d7c45a2924d..45f279fa4a416 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -15,9 +15,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <stdbool.h>
 #include <stdint.h>
 #include <errno.h>
diff --git a/lib/fs.c b/lib/fs.c
index af36bea0987fa..86efd4ed2ed80 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -20,9 +20,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <errno.h>
 #include <limits.h>
 
diff --git a/lib/inet_proto.c b/lib/inet_proto.c
index b379d8f8e720e..0836a4c96a0b4 100644
--- a/lib/inet_proto.c
+++ b/lib/inet_proto.c
@@ -18,9 +18,6 @@
 #include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 
 #include "rt_names.h"
 #include "utils.h"
diff --git a/misc/ss.c b/misc/ss.c
index 7e94f2c8d1baa..41e7762bb61f5 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -18,9 +18,6 @@
 #include <sys/uio.h>
 #include <netinet/in.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <errno.h>
 #include <netdb.h>
 #include <arpa/inet.h>
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
index 550b2101a0579..48b287f5ba3b2 100644
--- a/tc/em_ipset.c
+++ b/tc/em_ipset.c
@@ -20,9 +20,6 @@
 #include <netdb.h>
 #include <unistd.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <stdlib.h>
 #include <getopt.h>
 
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index baacc80dd94b7..2aeb56d9615f1 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -23,9 +23,6 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
-#ifdef HAVE_LIBBSD
-#include <bsd/string.h>
-#endif
 #include <dlfcn.h>
 #include "utils.h"
 #include "tc_util.h"
-- 
2.20.1