[package] add hping3 (#4699)
[openwrt/svn-archive/archive.git] / net / hping3 / patches / 101-endianness.patch
1 --- hping3-20051105_orig/hping2.h 2004-06-04 09:22:38.000000000 +0200
2 +++ hping3-20051105/hping2.h 2009-02-26 15:42:14.000000000 +0100
3 @@ -13,6 +13,7 @@
4 #ifndef _HPING2_H
5 #define _HPING2_H
6
7 +#include <endian.h>
8 #include <sys/types.h>
9 #include <sys/socket.h>
10 #include <netinet/in.h>
11 @@ -248,10 +249,10 @@
12 * IP header
13 */
14 struct myiphdr {
15 -#if defined(__LITTLE_ENDIAN_BITFIELD)
16 +#if __BYTE_ORDER == __LITTLE_ENDIAN
17 __u8 ihl:4,
18 version:4;
19 -#elif defined (__BIG_ENDIAN_BITFIELD)
20 +#elif __BYTE_ORDER == __BIG_ENDIAN
21 __u8 version:4,
22 ihl:4;
23 #else
24 @@ -287,10 +288,10 @@
25 __u16 th_dport; /* destination port */
26 __u32 th_seq; /* sequence number */
27 __u32 th_ack; /* acknowledgement number */
28 -#if defined (__LITTLE_ENDIAN_BITFIELD)
29 +#if __BYTE_ORDER == __LITTLE_ENDIAN
30 __u8 th_x2:4, /* (unused) */
31 th_off:4; /* data offset */
32 -#elif defined (__BIG_ENDIAN_BITFIELD)
33 +#elif __BYTE_ORDER == __BIG_ENDIAN
34 __u8 th_off:4, /* data offset */
35 th_x2:4; /* (unused) */
36 #else