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