[PATCH v2] libmnl src: Use double quotes in #includes for non-system headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libmnl carries a private copy of a number of system headers. These were mostly
still being included with angle brackets as though they were system headers.
Tested configurations of gcc would pick up the private copy in these cases but
it has been reported that others do not.

By using double quotes, developers are reminded that the code is using a
private header which may differ from the system one, in fact
./include/linux/netlink.h differs considerably from /usr/include/linux/netlink.h
at kernel-headers-4.4.14 and even more so at kernel-headers-4.16.12.

This patch is not applied to sources in ./examples/, because it is expected
that these may be compiled out-of-tree, where angle brackets are appropriate.

Signed-off-by: Duncan Roe <duncan_roe@xxxxxxxxxxxxxxx>
---
 include/libmnl/libmnl.h | 2 +-
 include/linux/netlink.h | 2 +-
 src/attr.c              | 2 +-
 src/callback.c          | 2 +-
 src/nlmsg.c             | 2 +-
 src/socket.c            | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h
index 0331da7..471b468 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <sys/socket.h> /* for sa_family_t */
-#include <linux/netlink.h>
+#include "linux/netlink.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index ced0e1a..80f3fad 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -1,7 +1,7 @@
 #ifndef __LINUX_NETLINK_H
 #define __LINUX_NETLINK_H
 
-#include <linux/socket.h> /* for __kernel_sa_family_t */
+#include "linux/socket.h" /* for __kernel_sa_family_t */
 #include <linux/types.h>
 
 #define NETLINK_ROUTE		0	/* Routing/device hook				*/
diff --git a/src/attr.c b/src/attr.c
index 0359ba9..ad83461 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -7,7 +7,7 @@
  * (at your option) any later version.
  */
 #include <limits.h>	/* for INT_MAX */
-#include <libmnl/libmnl.h>
+#include "libmnl/libmnl.h"
 #include <string.h>
 #include <errno.h>
 #include "internal.h"
diff --git a/src/callback.c b/src/callback.c
index 01181e6..b17edf6 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -8,7 +8,7 @@
  */
 
 #include <errno.h>
-#include <libmnl/libmnl.h>
+#include "libmnl/libmnl.h"
 #include "internal.h"
 
 static int mnl_cb_noop(const struct nlmsghdr *nlh, void *data)
diff --git a/src/nlmsg.c b/src/nlmsg.c
index f9448a5..673259f 100644
--- a/src/nlmsg.c
+++ b/src/nlmsg.c
@@ -12,7 +12,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
-#include <libmnl/libmnl.h>
+#include "libmnl/libmnl.h"
 #include "internal.h"
 
 /**
diff --git a/src/socket.c b/src/socket.c
index 31d6fbe..fea234a 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -7,7 +7,7 @@
  * (at your option) any later version.
  */
 
-#include <libmnl/libmnl.h>
+#include "libmnl/libmnl.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <stdlib.h>
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux