]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iproute2: various header include fixes for compiling with musl libc
authorNatanael Copa <ncopa@alpinelinux.org>
Tue, 27 May 2014 07:40:10 +0000 (07:40 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 28 May 2014 23:51:39 +0000 (16:51 -0700)
We need limits.h for LONG_MIN and LONG_MAX, sys/param.h for MIN and
sys/select for struct timeval.

This fixes the following compile errors with musl libc:

f_bpf.c: In function 'bpf_parse_opt':
f_bpf.c:181:12: error: 'LONG_MIN' undeclared (first use in this function)
   if (h == LONG_MIN || h == LONG_MAX) {
            ^
...

tc_util.o: In function `print_tcstats2_attr':
tc_util.c:(.text+0x13fe): undefined reference to `MIN'
tc_util.c:(.text+0x1465): undefined reference to `MIN'
tc_util.c:(.text+0x14ce): undefined reference to `MIN'
tc_util.c:(.text+0x154c): undefined reference to `MIN'
tc_util.c:(.text+0x160a): undefined reference to `MIN'
tc_util.o:tc_util.c:(.text+0x174e): more undefined references to `MIN' follow
...

tc_stab.o: In function `print_size_table':
tc_stab.c:(.text+0x40f): undefined reference to `MIN'
...

fdb.c:247:30: error: 'ULONG_MAX' undeclared (first use in this function)
        (vni >> 24) || vni == ULONG_MAX)
                              ^

lnstat.h:28:17: error: field 'last_read' has incomplete type
  struct timeval last_read;  /* last time of read */
                 ^

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
bridge/fdb.c
misc/lnstat.h
tc/f_bpf.c
tc/tc_stab.c
tc/tc_util.c

index 9b720e30fb1efc1c77b3708c91e7c246e2f5cf3e..336cf9d7bc25efad0488c9e20338292bbdc3b27e 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/if_ether.h>
 #include <linux/neighbour.h>
 #include <string.h>
+#include <limits.h>
 
 #include "libnetlink.h"
 #include "br_common.h"
index 06774ab3df0af6ffd4f08cc335f388d240581621..83dad9703b92ef30703162f35798779ca0eca2a2 100644 (file)
@@ -2,6 +2,7 @@
 #define _LNSTAT_H
 
 #include <limits.h>
+#include <sys/select.h>
 
 #define LNSTAT_VERSION "0.02 041002"
 
index d52d7d8ec52b66a382bcebb0bbd2fb8a415a8ad5..8f1593c9af7a0d1ba65d593e7532503484483e3c 100644 (file)
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include <errno.h>
+#include <limits.h>
 #include <linux/filter.h>
 #include <linux/if.h>
 
index 47b4e5e3544ef632d167300bb05a188f9357afb8..a8404f8eb636343b0498a01291175f05b2875782 100644 (file)
@@ -17,6 +17,7 @@
 #include <fcntl.h>
 #include <math.h>
 #include <sys/socket.h>
+#include <sys/param.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
index 15fb053445c34034b2e1ea0d958d83fa5f87879b..f1fca0a8b59803df97a1b106c1c930f70e105bfd 100644 (file)
@@ -16,6 +16,7 @@
 #include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
+#include <sys/param.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>