[git commit] libiproute: band-aid for old uclibc missing IFA_FLAGS

Denys Vlasenko vda.linux at googlemail.com
Tue Dec 29 16:34:34 UTC 2020


commit: https://git.busybox.net/busybox/commit/?id=ec9a5e608357acdc6e793d63bddf84030aa4f024
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/libiproute/ipaddress.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 91fabb1fd..dfd84c000 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -21,10 +21,15 @@
 #define IFF_LOWER_UP  0x10000  /* driver signals L1 up */
 #endif
 
+/* for old uclibc */
 #ifndef IFA_F_NOPREFIXROUTE
 # define IFA_FLAGS           8
-/* ifa_flags */
 # define IFA_F_NOPREFIXROUTE 0x200
+enum { /* can't do this with preporcessor, IFA_MAX is an (enum - 1), not preprocessor constant */
+	REAL_IFA_MAX = (IFA_MAX >= IFA_FLAGS) ? IFA_MAX : IFA_FLAGS,
+};
+# undef IFA_MAX
+# define IFA_MAX REAL_IFA_MAX
 #endif
 
 struct filter_t {


More information about the busybox-cvs mailing list