summaryrefslogtreecommitdiffstats
path: root/net/hping3/patches/101-endianness.patch
blob: 2666647ac77eea73e94c4c32d104e2263fa44a7f (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
--- a/hping2.h
+++ b/hping2.h
@@ -13,6 +13,7 @@
 #ifndef _HPING2_H
 #define _HPING2_H
 
+#include <endian.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -248,10 +249,10 @@
  * IP header
  */
 struct myiphdr {
-#if defined(__LITTLE_ENDIAN_BITFIELD)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
         __u8    ihl:4,
                 version:4;
-#elif defined (__BIG_ENDIAN_BITFIELD)
+#elif __BYTE_ORDER == __BIG_ENDIAN
         __u8    version:4,
                 ihl:4;
 #else
@@ -287,10 +288,10 @@ struct mytcphdr {
 	__u16	th_dport;               /* destination port */
 	__u32	th_seq;                 /* sequence number */
 	__u32	th_ack;                 /* acknowledgement number */
-#if defined (__LITTLE_ENDIAN_BITFIELD)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
 	__u8    th_x2:4,                /* (unused) */
 		th_off:4;               /* data offset */
-#elif defined (__BIG_ENDIAN_BITFIELD)
+#elif __BYTE_ORDER == __BIG_ENDIAN
 	__u8    th_off:4,               /* data offset */
 		th_x2:4;                /* (unused) */
 #else
--- a/bytesex.h
+++ b/bytesex.h
@@ -9,9 +9,12 @@
 
 #if 	defined(__i386__) \
 	|| defined(__alpha__) \
+	|| (defined(__arm__) && (defined(ARMEL) || defined(__ARMEL__)))  \
 	|| (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
 #define BYTE_ORDER_LITTLE_ENDIAN
-#elif 	defined(__mc68000__) \
+#elif defined(__mc68000__) \
+	|| (defined(__arm__) && (defined(ARMEB) || defined(__ARMEB__))) \
+	|| defined (__avr32__) \
 	|| defined (__sparc__) \
 	|| defined (__sparc) \
 	|| defined (__PPC__) \