[systemd-devel] [PATCH 1/2] Update IFA_MAX adding IFA_FLAGS

Alexander Sverdlin alexander.sverdlin at gmail.com
Tue Apr 7 14:05:38 PDT 2015


Fixes the following compilation problem:
src/libsystemd/sd-rtnl/rtnl-types.c:361:9: error: array index in initializer exceeds array bounds
         [IFA_FLAGS]             = { .type = NLA_U32 },
         ^
src/libsystemd/sd-rtnl/rtnl-types.c:361:9: error: (near initialization for 'rtnl_address_types')

Also include if_addr.h into missing.h so that it's possible to redefine __IFA_MAX.
---
 src/shared/missing.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/missing.h b/src/shared/missing.h
index ae84053..86c917b 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <linux/oom.h>
 #include <linux/input.h>
+#include <linux/if_addr.h>
 #include <linux/if_link.h>
 #include <linux/loop.h>
 #include <linux/audit.h>
@@ -861,6 +862,8 @@ static inline int setns(int fd, int nstype) {

 #if !HAVE_DECL_IFA_FLAGS
 #define IFA_FLAGS 8
+#define __IFA_MAX 9
+#define IFA_MAX (__IFA_MAX - 1)
 #endif

 #ifndef MAX_AUDIT_MESSAGE_LENGTH


More information about the systemd-devel mailing list