[OpenWrt-Devel] [PATCH] libnl-tiny: include <sys/socket.h>
Rafał Miłecki
zajec5 at gmail.com
Wed Nov 11 05:35:29 EST 2015
Currently some libnl headers require application code to include
dependencies on its own. E.g. a simple include of <linux/netlink.h>
will trigger an error:
/usr/include/libnl-tiny/linux/netlink.h:32:2: error: unknown type name 'sa_family_t'
Similarly including <netlink/handlers.h> causes:
/usr/include/libnl-tiny/netlink/handlers.h:133:19: warning: 'struct ucred' declared inside parameter list [enabled by default]
Fix it by including <sys/socket.h> where needed in libnl headers.
Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
package/libs/libnl-tiny/src/include/linux/netlink.h | 1 +
package/libs/libnl-tiny/src/include/netlink/handlers.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/package/libs/libnl-tiny/src/include/linux/netlink.h b/package/libs/libnl-tiny/src/include/linux/netlink.h
index d252103..3d6d367 100644
--- a/package/libs/libnl-tiny/src/include/linux/netlink.h
+++ b/package/libs/libnl-tiny/src/include/linux/netlink.h
@@ -3,6 +3,7 @@
#include <linux/socket.h> /* for sa_family_t */
#include <linux/types.h>
+#include <sys/socket.h> /* for sa_family_t */
#define NETLINK_ROUTE 0 /* Routing/device hook */
#define NETLINK_UNUSED 1 /* Unused number */
diff --git a/package/libs/libnl-tiny/src/include/netlink/handlers.h b/package/libs/libnl-tiny/src/include/netlink/handlers.h
index 7fb53b4..f5c933d 100644
--- a/package/libs/libnl-tiny/src/include/netlink/handlers.h
+++ b/package/libs/libnl-tiny/src/include/netlink/handlers.h
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdint.h>
+#include <sys/socket.h>
#include <sys/types.h>
#include <netlink/netlink-compat.h>
#include <netlink/netlink-kernel.h>
--
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list