linma / rpms / iproute

Forked from rpms/iproute 4 years ago
Clone

Blame SOURCES/0062-Include-bsd-string.h-only-in-include-utils.h.patch

7e752c
From f416b73a7f47494cf6d18cdaad5e86709bc43a63 Mon Sep 17 00:00:00 2001
7e752c
From: Andrea Claudi <aclaudi@redhat.com>
7e752c
Date: Thu, 13 Jun 2019 14:37:57 +0200
7e752c
Subject: [PATCH] Include bsd/string.h only in include/utils.h
7e752c
7e752c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1716361
7e752c
Upstream Status: iproute2.git commit 6d2fd4a53f63b
7e752c
7e752c
commit 6d2fd4a53f63bd20667b1a8f2ec8fde1fc3a54d4
7e752c
Author: Luca Boccassi <bluca@debian.org>
7e752c
Date:   Thu Nov 1 22:25:27 2018 +0000
7e752c
7e752c
    Include bsd/string.h only in include/utils.h
7e752c
7e752c
    This is simpler and cleaner, and avoids having to include the header
7e752c
    from every file where the functions are used. The prototypes of the
7e752c
    internal implementation are in this header, so utils.h will have to be
7e752c
    included anyway for those.
7e752c
7e752c
    Fixes: 508f3c231efb ("Use libbsd for strlcpy if available")
7e752c
7e752c
    Signed-off-by: Luca Boccassi <bluca@debian.org>
7e752c
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
7e752c
---
7e752c
 genl/ctrl.c           | 3 ---
7e752c
 include/utils.h       | 4 ++++
7e752c
 ip/iplink.c           | 3 ---
7e752c
 ip/ipnetns.c          | 3 ---
7e752c
 ip/iproute_lwtunnel.c | 3 ---
7e752c
 ip/ipvrf.c            | 3 ---
7e752c
 ip/ipxfrm.c           | 3 ---
7e752c
 ip/tunnel.c           | 3 ---
7e752c
 ip/xfrm_state.c       | 3 ---
7e752c
 lib/bpf.c             | 3 ---
7e752c
 lib/fs.c              | 3 ---
7e752c
 lib/inet_proto.c      | 3 ---
7e752c
 misc/ss.c             | 3 ---
7e752c
 tc/em_ipset.c         | 3 ---
7e752c
 tc/m_pedit.c          | 3 ---
7e752c
 15 files changed, 4 insertions(+), 42 deletions(-)
7e752c
7e752c
diff --git a/genl/ctrl.c b/genl/ctrl.c
7e752c
index 4063ec0ba474b..0d9c5f2517b78 100644
7e752c
--- a/genl/ctrl.c
7e752c
+++ b/genl/ctrl.c
7e752c
@@ -18,9 +18,6 @@
7e752c
 #include <netinet/in.h>
7e752c
 #include <arpa/inet.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 
7e752c
 #include "utils.h"
7e752c
 #include "genl_utils.h"
7e752c
diff --git a/include/utils.h b/include/utils.h
7e752c
index 8cb4349e8a89f..c32b37a1797d8 100644
7e752c
--- a/include/utils.h
7e752c
+++ b/include/utils.h
7e752c
@@ -9,6 +9,10 @@
7e752c
 #include <stdbool.h>
7e752c
 #include <time.h>
7e752c
 
7e752c
+#ifdef HAVE_LIBBSD
7e752c
+#include <bsd/string.h>
7e752c
+#endif
7e752c
+
7e752c
 #include "libnetlink.h"
7e752c
 #include "ll_map.h"
7e752c
 #include "rtm_map.h"
7e752c
diff --git a/ip/iplink.c b/ip/iplink.c
7e752c
index 2f8f3bf1f84bb..0ba5f1af76697 100644
7e752c
--- a/ip/iplink.c
7e752c
+++ b/ip/iplink.c
7e752c
@@ -24,9 +24,6 @@
7e752c
 #include <netinet/in.h>
7e752c
 #include <arpa/inet.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <sys/ioctl.h>
7e752c
 #include <stdbool.h>
7e752c
 #include <linux/mpls.h>
7e752c
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
7e752c
index 5991592e947b6..368be0cbc0a48 100644
7e752c
--- a/ip/ipnetns.c
7e752c
+++ b/ip/ipnetns.c
7e752c
@@ -8,9 +8,6 @@
7e752c
 #include <sys/syscall.h>
7e752c
 #include <stdio.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <sched.h>
7e752c
 #include <fcntl.h>
7e752c
 #include <dirent.h>
7e752c
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
7e752c
index be9f60c3b2137..388cd19a3ef0b 100644
7e752c
--- a/ip/iproute_lwtunnel.c
7e752c
+++ b/ip/iproute_lwtunnel.c
7e752c
@@ -16,9 +16,6 @@
7e752c
 #include <unistd.h>
7e752c
 #include <fcntl.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <linux/ila.h>
7e752c
 #include <linux/lwtunnel.h>
7e752c
 #include <linux/mpls_iptunnel.h>
7e752c
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
7e752c
index 8572b4f23e3dc..8a6b7f977b142 100644
7e752c
--- a/ip/ipvrf.c
7e752c
+++ b/ip/ipvrf.c
7e752c
@@ -21,9 +21,6 @@
7e752c
 #include <stdlib.h>
7e752c
 #include <unistd.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <dirent.h>
7e752c
 #include <errno.h>
7e752c
 #include <limits.h>
7e752c
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
7e752c
index 5304dfc1af906..12c2f721571b6 100644
7e752c
--- a/ip/ipxfrm.c
7e752c
+++ b/ip/ipxfrm.c
7e752c
@@ -28,9 +28,6 @@
7e752c
 #include <stdio.h>
7e752c
 #include <stdlib.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <sys/types.h>
7e752c
 #include <sys/socket.h>
7e752c
 #include <time.h>
7e752c
diff --git a/ip/tunnel.c b/ip/tunnel.c
7e752c
index d54505d483d22..79de7f2406f0e 100644
7e752c
--- a/ip/tunnel.c
7e752c
+++ b/ip/tunnel.c
7e752c
@@ -24,9 +24,6 @@
7e752c
 
7e752c
 #include <stdio.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <unistd.h>
7e752c
 #include <errno.h>
7e752c
 #include <sys/types.h>
7e752c
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
7e752c
index 0c8df7e6e10cd..85d959cc4f44f 100644
7e752c
--- a/ip/xfrm_state.c
7e752c
+++ b/ip/xfrm_state.c
7e752c
@@ -27,9 +27,6 @@
7e752c
 #include <stdio.h>
7e752c
 #include <stdlib.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <netdb.h>
7e752c
 #include "utils.h"
7e752c
 #include "xfrm.h"
7e752c
diff --git a/lib/bpf.c b/lib/bpf.c
7e752c
index 35d7c45a2924d..45f279fa4a416 100644
7e752c
--- a/lib/bpf.c
7e752c
+++ b/lib/bpf.c
7e752c
@@ -15,9 +15,6 @@
7e752c
 #include <stdlib.h>
7e752c
 #include <unistd.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <stdbool.h>
7e752c
 #include <stdint.h>
7e752c
 #include <errno.h>
7e752c
diff --git a/lib/fs.c b/lib/fs.c
7e752c
index af36bea0987fa..86efd4ed2ed80 100644
7e752c
--- a/lib/fs.c
7e752c
+++ b/lib/fs.c
7e752c
@@ -20,9 +20,6 @@
7e752c
 #include <stdlib.h>
7e752c
 #include <unistd.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <errno.h>
7e752c
 #include <limits.h>
7e752c
 
7e752c
diff --git a/lib/inet_proto.c b/lib/inet_proto.c
7e752c
index b379d8f8e720e..0836a4c96a0b4 100644
7e752c
--- a/lib/inet_proto.c
7e752c
+++ b/lib/inet_proto.c
7e752c
@@ -18,9 +18,6 @@
7e752c
 #include <netinet/in.h>
7e752c
 #include <netdb.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 
7e752c
 #include "rt_names.h"
7e752c
 #include "utils.h"
7e752c
diff --git a/misc/ss.c b/misc/ss.c
7e752c
index 7e94f2c8d1baa..41e7762bb61f5 100644
7e752c
--- a/misc/ss.c
7e752c
+++ b/misc/ss.c
7e752c
@@ -18,9 +18,6 @@
7e752c
 #include <sys/uio.h>
7e752c
 #include <netinet/in.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <errno.h>
7e752c
 #include <netdb.h>
7e752c
 #include <arpa/inet.h>
7e752c
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
7e752c
index 550b2101a0579..48b287f5ba3b2 100644
7e752c
--- a/tc/em_ipset.c
7e752c
+++ b/tc/em_ipset.c
7e752c
@@ -20,9 +20,6 @@
7e752c
 #include <netdb.h>
7e752c
 #include <unistd.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <stdlib.h>
7e752c
 #include <getopt.h>
7e752c
 
7e752c
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
7e752c
index baacc80dd94b7..2aeb56d9615f1 100644
7e752c
--- a/tc/m_pedit.c
7e752c
+++ b/tc/m_pedit.c
7e752c
@@ -23,9 +23,6 @@
7e752c
 #include <netinet/in.h>
7e752c
 #include <arpa/inet.h>
7e752c
 #include <string.h>
7e752c
-#ifdef HAVE_LIBBSD
7e752c
-#include <bsd/string.h>
7e752c
-#endif
7e752c
 #include <dlfcn.h>
7e752c
 #include "utils.h"
7e752c
 #include "tc_util.h"
7e752c
-- 
7e752c
2.20.1
7e752c