Merge pull request #11353 from kvuorine/fwknop-fixes
[feed/packages.git] / net / snort3 / patches / 003-fix-bigendian.patch
1 --- a/src/codecs/ip/cd_ipv4.cc 2018-08-28 02:01:02.000000000 -0400
2 +++ b/src/codecs/ip/cd_ipv4.cc 2020-07-04 17:45:57.125755874 -0400
3 @@ -358,8 +358,8 @@
4 /* Loopback traffic - don't use htonl for speed reasons -
5 * s_addr is always in network order */
6 #ifdef WORDS_BIGENDIAN
7 - msb_src = (iph.ip_src >> 24);
8 - msb_dst = (iph.ip_dst >> 24);
9 + msb_src = ((*iph).ip_src >> 24);
10 + msb_dst = ((*iph).ip_dst >> 24);
11 #else
12 msb_src = (uint8_t)(iph->ip_src & 0xff);
13 msb_dst = (uint8_t)(iph->ip_dst & 0xff);
14 --- a/src/network_inspectors/appid/appid_detector.h 2018-08-28 02:01:02.000000000 -0400
15 +++ b/src/network_inspectors/appid/appid_detector.h 2020-07-04 18:07:24.196714422 -0400
16 @@ -52,6 +52,27 @@
17 DETECTOR_TYPE_NOT_SET
18 };
19
20 +#define BYTE_SWAP_16(x) \
21 + ((uint16_t)((((uint16_t)(x) & 0xff00) >> 8) | \
22 + (((uint16_t)(x) & 0x00ff) << 8)))
23 +
24 +#define BYTE_SWAP_32(x) \
25 + ((uint32_t)((((uint32_t)(x) & 0xff000000) >> 24) | \
26 + (((uint32_t)(x) & 0x00ff0000) >> 8) | \
27 + (((uint32_t)(x) & 0x0000ff00) << 8) | \
28 + (((uint32_t)(x) & 0x000000ff) << 24)))
29 +
30 +#define BYTE_SWAP_64(x) \
31 + ((uint64_t)((((uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \
32 + (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \
33 + (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \
34 + (((uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \
35 + (((uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \
36 + (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \
37 + (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \
38 + (((uint64_t)(x) & 0x00000000000000ffULL) << 56)))
39 +
40 +
41 typedef std::vector<AppRegistryEntry> FlowApplicationInfo;
42
43 struct AppIdFlowContentPattern