summaryrefslogtreecommitdiff
path: root/src/libsystemd-rtnl
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-rtnl')
-rw-r--r--src/libsystemd-rtnl/rtnl-internal.h2
-rw-r--r--src/libsystemd-rtnl/rtnl-message.c1
-rw-r--r--src/libsystemd-rtnl/rtnl-util.c1
-rw-r--r--src/libsystemd-rtnl/rtnl-util.h7
-rw-r--r--src/libsystemd-rtnl/sd-rtnl.c1
-rw-r--r--src/libsystemd-rtnl/test-rtnl.c2
6 files changed, 14 insertions, 0 deletions
diff --git a/src/libsystemd-rtnl/rtnl-internal.h b/src/libsystemd-rtnl/rtnl-internal.h
index b34e7ea126..b05290fd89 100644
--- a/src/libsystemd-rtnl/rtnl-internal.h
+++ b/src/libsystemd-rtnl/rtnl-internal.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <linux/netlink.h>
+
#include "refcnt.h"
struct sd_rtnl {
diff --git a/src/libsystemd-rtnl/rtnl-message.c b/src/libsystemd-rtnl/rtnl-message.c
index 9a40a75a9f..85cf55a3cd 100644
--- a/src/libsystemd-rtnl/rtnl-message.c
+++ b/src/libsystemd-rtnl/rtnl-message.c
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <linux/rtnetlink.h>
#include <netinet/in.h>
#include <netinet/ether.h>
#include <stdbool.h>
diff --git a/src/libsystemd-rtnl/rtnl-util.c b/src/libsystemd-rtnl/rtnl-util.c
index 93804bb744..9707aa04a6 100644
--- a/src/libsystemd-rtnl/rtnl-util.c
+++ b/src/libsystemd-rtnl/rtnl-util.c
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <linux/rtnetlink.h>
#include <netinet/ether.h>
#include "sd-rtnl.h"
diff --git a/src/libsystemd-rtnl/rtnl-util.h b/src/libsystemd-rtnl/rtnl-util.h
index 902ff646cf..ba0f71f944 100644
--- a/src/libsystemd-rtnl/rtnl-util.h
+++ b/src/libsystemd-rtnl/rtnl-util.h
@@ -23,7 +23,14 @@
#include <netinet/ether.h>
+#include "util.h"
#include "sd-rtnl.h"
int rtnl_set_link_name(sd_rtnl *rtnl, int ifindex, const char *name);
int rtnl_set_link_properties(sd_rtnl *rtnl, int ifindex, const struct ether_addr *mac, unsigned mtu);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl*, sd_rtnl_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl_message*, sd_rtnl_message_unref);
+
+#define _cleanup_sd_rtnl_unref_ _cleanup_(sd_rtnl_unrefp)
+#define _cleanup_sd_rtnl_message_unref_ _cleanup_(sd_rtnl_message_unrefp)
diff --git a/src/libsystemd-rtnl/sd-rtnl.c b/src/libsystemd-rtnl/sd-rtnl.c
index ed145b9ab3..8ea11df808 100644
--- a/src/libsystemd-rtnl/sd-rtnl.c
+++ b/src/libsystemd-rtnl/sd-rtnl.c
@@ -27,6 +27,7 @@
#include "sd-rtnl.h"
#include "rtnl-internal.h"
+#include "rtnl-util.h"
static int sd_rtnl_new(sd_rtnl **ret) {
sd_rtnl *rtnl;
diff --git a/src/libsystemd-rtnl/test-rtnl.c b/src/libsystemd-rtnl/test-rtnl.c
index 2d2b2373b6..39a83f3532 100644
--- a/src/libsystemd-rtnl/test-rtnl.c
+++ b/src/libsystemd-rtnl/test-rtnl.c
@@ -19,12 +19,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <linux/rtnetlink.h>
#include <netinet/ether.h>
#include "util.h"
#include "macro.h"
#include "sd-rtnl.h"
#include "socket-util.h"
+#include "rtnl-util.h"
static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
_cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message;