aboutsummaryrefslogtreecommitdiffstats
path: root/main/iproute2/0001-iproute2-various-header-include-fixes-for-compiling-.patch
blob: d8b36dcc97a9907bc31c41354c3ee64887f42148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 9bf5b7a91b67ac47a00c1ed2ccd959ebfba4fb48 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 27 May 2014 07:16:04 +0000
Subject: [PATCH] iproute2: various header include fixes for compiling with
 musl libc

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  | 1 +
 misc/lnstat.h | 1 +
 tc/f_bpf.c    | 1 +
 tc/tc_stab.c  | 1 +
 tc/tc_util.c  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/bridge/fdb.c b/bridge/fdb.c
index 9b720e3..336cf9d 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -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"
diff --git a/misc/lnstat.h b/misc/lnstat.h
index 06774ab..83dad97 100644
--- a/misc/lnstat.h
+++ b/misc/lnstat.h
@@ -2,6 +2,7 @@
 #define _LNSTAT_H
 
 #include <limits.h>
+#include <sys/select.h>
 
 #define LNSTAT_VERSION "0.02 041002"
 
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index d52d7d8..8f1593c 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include <errno.h>
+#include <limits.h>
 #include <linux/filter.h>
 #include <linux/if.h>
 
diff --git a/tc/tc_stab.c b/tc/tc_stab.c
index 47b4e5e..a8404f8 100644
--- a/tc/tc_stab.c
+++ b/tc/tc_stab.c
@@ -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>
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 15fb053..f1fca0a 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -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>
-- 
1.9.3