summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/check_pf.c5
-rw-r--r--sysdeps/unix/sysv/linux/netlinkaccess.h18
2 files changed, 19 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index 13ccd7acb4..ebe4d699b1 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -27,13 +27,10 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <asm/types.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-
#include <not-cancel.h>
#include <kernel-features.h>
+#include "netlinkaccess.h"
#ifndef IFA_F_TEMPORARY
# define IFA_F_TEMPORARY IFA_F_SECONDARY
diff --git a/sysdeps/unix/sysv/linux/netlinkaccess.h b/sysdeps/unix/sysv/linux/netlinkaccess.h
index 92310b77df..48903d3725 100644
--- a/sysdeps/unix/sysv/linux/netlinkaccess.h
+++ b/sysdeps/unix/sysv/linux/netlinkaccess.h
@@ -25,6 +25,24 @@
#include <kernel-features.h>
+#ifndef IFA_MAX
+/* 2.6.19 kernel headers helpfully removed some macros and
+ moved lots of stuff into new headers, some of which aren't
+ included by linux/rtnetlink.h. */
+#include <linux/if_addr.h>
+#endif
+
+#ifndef IFA_RTA
+# define IFA_RTA(r) \
+ ((struct rtattr*) ((char*)(r) + NLMSG_ALIGN (sizeof (struct ifaddrmsg))))
+# define IFA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifaddrmsg))
+#endif
+
+#ifndef IFLA_RTA
+# define IFLA_RTA(r) \
+ ((struct rtattr*) ((char*)(r) + NLMSG_ALIGN (sizeof (struct ifinfomsg))))
+# define IFLA_PAYLOAD(n) NLMSG_PAYLOAD (n, sizeof (struct ifinfomsg))
+#endif
struct netlink_res
{