The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / batctl / 0001-musl-fixes.patch
1 musl does not allow including netinet/* and linux/* headers together.
2 batctl includes netinet/if_ether.h indirectly via net/ethernet.h,
3 so netinet/if_ether.h must be used instead of linux/if_ether.h.
4
5 __be16 and __be32 are linux-specific typedefs for uint16_t and
6 uint32_t with __attribute__((bitwise)) that has no effect
7 outside of the kernel.
8
9 Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
10
11 --- batctl-2014.4.0/ping.c
12 +++ batctl-2014.4.0/ping.c
13 @@ -34,7 +34,7 @@
14  #include <stdint.h>
15  #include <sys/select.h>
16  #include <sys/time.h>
17 -#include <linux/if_ether.h>
18 +#include <netinet/if_ether.h>
19  
20  #include "main.h"
21  #include "ping.h"
22 --- batctl-2014.4.0/tcpdump.h
23 +++ batctl-2014.4.0/tcpdump.h
24 @@ -23,7 +23,7 @@
25  #define _BATCTL_TCPDUMP_H
26  
27  #include <netpacket/packet.h>
28 -#include <linux/if_ether.h>
29 +#include <netinet/if_ether.h>
30  #include <net/if_arp.h>
31  #include <sys/types.h>
32  #include "main.h"
33 --- batctl-2014.4.0/traceroute.c
34 +++ batctl-2014.4.0/traceroute.c
35 @@ -28,7 +28,7 @@
36  #include <unistd.h>
37  #include <fcntl.h>
38  #include <string.h>
39 -#include <linux/if_ether.h>
40 +#include <netinet/if_ether.h>
41  #include <stddef.h>
42  #include <sys/select.h>
43  #include <sys/time.h>
44 --- batctl-2014.4.0/packet.h
45 +++ batctl-2014.4.0/packet.h
46 @@ -196,7 +196,7 @@
47  struct batadv_bla_claim_dst {
48         uint8_t magic[3];       /* FF:43:05 */
49         uint8_t type;           /* bla_claimframe */
50 -       __be16 group;           /* group id */
51 +       uint16_t group;         /* group id */
52  };
53  #pragma pack()
54  
55 @@ -213,12 +213,12 @@
56         uint8_t  version;
57         uint8_t  ttl;
58         uint8_t  flags;
59 -       __be32   seqno;
60 +       uint32_t   seqno;
61         uint8_t  orig[ETH_ALEN];
62         uint8_t  prev_sender[ETH_ALEN];
63         uint8_t  reserved;
64         uint8_t  tq;
65 -       __be16   tvlv_len;
66 +       uint16_t   tvlv_len;
67         /* __packed is not needed as the struct size is divisible by 4,
68          * and the largest data type in this struct has a size of 4.
69          */
70 @@ -273,7 +273,7 @@
71         uint8_t  orig[ETH_ALEN];
72         uint8_t  uid;
73         uint8_t  reserved;
74 -       __be16   seqno;
75 +       uint16_t   seqno;
76  };
77  
78  #define BATADV_RR_LEN 16
79 @@ -300,7 +300,7 @@
80         uint8_t  orig[ETH_ALEN];
81         uint8_t  uid;
82         uint8_t  rr_cur;
83 -       __be16   seqno;
84 +       uint16_t   seqno;
85         uint8_t  rr[BATADV_RR_LEN][ETH_ALEN];
86  };
87  
88 @@ -380,8 +380,8 @@
89  #endif
90         uint8_t dest[ETH_ALEN];
91         uint8_t orig[ETH_ALEN];
92 -       __be16  seqno;
93 -       __be16  total_size;
94 +       uint16_t  seqno;
95 +       uint16_t  total_size;
96  };
97  
98  /**
99 @@ -398,7 +398,7 @@
100         uint8_t  version;  /* batman version field */
101         uint8_t  ttl;
102         uint8_t  reserved;
103 -       __be32   seqno;
104 +       uint32_t   seqno;
105         uint8_t  orig[ETH_ALEN];
106         /* "4 bytes boundary + 2 bytes" long to make the payload after the
107          * following ethernet header again 4 bytes boundary aligned
108 @@ -431,14 +431,14 @@
109         /* uint8_t  first_dest[ETH_ALEN]; - saved in mac header destination */
110         uint8_t  first_source[ETH_ALEN];
111         uint8_t  first_orig_dest[ETH_ALEN];
112 -       __be32   first_crc;
113 +       uint32_t   first_crc;
114         uint8_t  second_ttl;
115         uint8_t  second_ttvn;
116         uint8_t  second_dest[ETH_ALEN];
117         uint8_t  second_source[ETH_ALEN];
118         uint8_t  second_orig_dest[ETH_ALEN];
119 -       __be32   second_crc;
120 -       __be16   coded_len;
121 +       uint32_t   second_crc;
122 +       uint16_t   coded_len;
123  };
124  
125  #pragma pack()
126 @@ -461,7 +461,7 @@
127         uint8_t  reserved;
128         uint8_t  dst[ETH_ALEN];
129         uint8_t  src[ETH_ALEN];
130 -       __be16   tvlv_len;
131 +       uint16_t   tvlv_len;
132         uint16_t align;
133  };
134  
135 @@ -474,7 +474,7 @@
136  struct batadv_tvlv_hdr {
137         uint8_t type;
138         uint8_t version;
139 -       __be16  len;
140 +       uint16_t  len;
141  };
142  
143  /**
144 @@ -484,8 +484,8 @@
145   * @bandwidth_up: advertised uplink upload bandwidth
146   */
147  struct batadv_tvlv_gateway_data {
148 -       __be32 bandwidth_down;
149 -       __be32 bandwidth_up;
150 +       uint32_t bandwidth_down;
151 +       uint32_t bandwidth_up;
152  };
153  
154  /**
155 @@ -498,7 +498,7 @@
156  struct batadv_tvlv_tt_data {
157         uint8_t flags;
158         uint8_t ttvn;
159 -       __be16  num_vlan;
160 +       uint16_t  num_vlan;
161  };
162  
163  /**
164 @@ -509,8 +509,8 @@
165   * @reserved: unused, useful for alignment purposes
166   */
167  struct batadv_tvlv_tt_vlan_data {
168 -       __be32  crc;
169 -       __be16  vid;
170 +       uint32_t        crc;
171 +       uint16_t        vid;
172         uint16_t reserved;
173  };
174  
175 @@ -526,7 +526,7 @@
176         uint8_t flags;
177         uint8_t reserved[3];
178         uint8_t addr[ETH_ALEN];
179 -       __be16 vid;
180 +       uint16_t vid;
181  };
182  
183  /**
184 @@ -536,7 +536,7 @@
185   */
186  struct batadv_tvlv_roam_adv {
187         uint8_t  client[ETH_ALEN];
188 -       __be16 vid;
189 +       uint16_t vid;
190  };
191  
192  /**