From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 1/4] rtnl: Fixup rtnetlink includes
Date: Wed, 8 Nov 2023 17:45:20 -0600 [thread overview]
Message-ID: <20231108234544.1050199-1-denkenz@gmail.com> (raw)
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.
---
ell/netconfig.c | 4 ++++
ell/rtnl.c | 5 ++++-
ell/rtnl.h | 3 ++-
unit/test-rtnl.c | 4 ++++
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ell/netconfig.c b/ell/netconfig.c
index 0e00981e7e98..9b01581fff45 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 7f14faa7abc6..ad2dca2f9e3c 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 efe58b27a075..fa5d99eb4b53 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 02629040865d..cd944af64de9 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"
--
2.42.0
next reply other threads:[~2023-11-08 23:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 23:45 Denis Kenzior [this message]
2023-11-08 23:45 ` [PATCH 2/4] netlink: Fix compilation on really old platforms Denis Kenzior
2023-11-09 14:53 ` Marcel Holtmann
2023-11-09 15:46 ` Denis Kenzior
2023-11-08 23:45 ` [PATCH 3/4] rtnl: " Denis Kenzior
2023-11-08 23:45 ` [PATCH 4/4] examples: Fix compilation on old systems Denis Kenzior
2023-11-09 14:50 ` [PATCH 1/4] rtnl: Fixup rtnetlink includes Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231108234544.1050199-1-denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ell@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).