Skip to contentSkip to conversation

lapi: Add missing IFA_FLAGS

PATCH New Petr Vorel 2 participants 3 messages May 14, 2021 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v3 1/1 lapi: Add missing IFA_FLAGS

From: Petr Vorel <[email protected]>

and use them in tst_netdevice.c. This fixes on older toolchains (e.g. sourcery-arm from Buildroot):

tst_netdevice.c: In function 'modify_address':
tst_netdevice.c:218:44: error: 'IFA_FLAGS' undeclared (first use in this function)
if (!tst_rtnl_add_attr(file, lineno, ctx, IFA_FLAGS, &addr_flags,

Fixes bc2151a65 ("lib: Add helper functions for managing network interfaces")

---
Changes v2->v3:
* drop autotools check (Cyril)

Kind regards,
Petr

 include/lapi/rtnetlink.h | 13 +++++++++++++
 lib/tst_netdevice.c      |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 include/lapi/rtnetlink.h
include/lapi/rtnetlink.h new file +13 -0
new file mode 100644
index 000000000..8a1b5385b
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2021 Petr Vorel <[email protected]> */
+
+#ifndef LAPI_IF_ADDR_H__
+# define LAPI_IF_ADDR_H__
+
+#include <linux/rtnetlink.h>
+
+#ifndef IFA_FLAGS
+# define IFA_FLAGS 8
+#endif
+
+#endif	/* LAPI_IF_ADDR_H__ */
lib/tst_netdevice.c +2 -1
index 5ca523759..d098173d5 100644
@@ -5,10 +5,11 @@
 
 #include <asm/types.h>
 #include <linux/netlink.h>
-#include <linux/rtnetlink.h>
 #include <linux/veth.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#include "lapi/rtnetlink.h"
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "tst_rtnetlink.h"
Signature · 1 line
2.31.1