aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2023-11-08 17:45:20 -0600
committerMarcel Holtmann <marcel@holtmann.org>2023-11-09 15:48:53 +0100
commita042331c4b5d1f626d4b6ce499b383b9baad04bc (patch)
treeaec3d30d1b088c557a0ffeef7783573c05f8d4a5
parent45e0ca286116bc5fd75ce03aa989b931894ceafc (diff)
rtnl: Fixup rtnetlink includes
man 7 rtnetlink suggests the 4 includes listed should be used. Also, remove rtnetlink.h inclusion from rtnl.h and move it into the individual code files.
-rw-r--r--ell/netconfig.c4
-rw-r--r--ell/rtnl.c5
-rw-r--r--ell/rtnl.h3
-rw-r--r--unit/test-rtnl.c4
4 files changed, 14 insertions, 2 deletions
diff --git a/ell/netconfig.c b/ell/netconfig.c
index 0e00981e..9b01581f 100644
--- a/ell/netconfig.c
+++ b/ell/netconfig.c
@@ -9,6 +9,10 @@
#include <config.h>
#endif
+#include <asm/types.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <sys/socket.h>
#include <net/if.h>
#include <linux/types.h>
#include <linux/if_ether.h>
diff --git a/ell/rtnl.c b/ell/rtnl.c
index 7f14faa7..ad2dca2f 100644
--- a/ell/rtnl.c
+++ b/ell/rtnl.c
@@ -10,12 +10,15 @@
#endif
#define _GNU_SOURCE
+#include <asm/types.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <sys/socket.h>
#include <linux/if.h>
#include <linux/icmpv6.h>
#include <linux/neighbour.h>
#include <linux/if_ether.h>
#include <net/if_arp.h>
-#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
diff --git a/ell/rtnl.h b/ell/rtnl.h
index efe58b27..fa5d99eb 100644
--- a/ell/rtnl.h
+++ b/ell/rtnl.h
@@ -9,13 +9,14 @@
#define __ELL_RTNL_H
#include <stdint.h>
-#include <linux/rtnetlink.h>
#include <ell/cleanup.h>
#ifdef __cplusplus
extern "C" {
#endif
+struct rtmsg;
+struct ifaddrmsg;
struct l_rtnl_address;
struct l_rtnl_route;
diff --git a/unit/test-rtnl.c b/unit/test-rtnl.c
index 02629040..cd944af6 100644
--- a/unit/test-rtnl.c
+++ b/unit/test-rtnl.c
@@ -16,6 +16,10 @@
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
+#include <asm/types.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <sys/socket.h>
#include <ell/ell.h>
#include "ell/dbus-private.h"