Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions src/plugins/input/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,31 @@ inline uint16_t parse_eth_hdr(const u_char* data_ptr, uint16_t data_len, Packet*
DEBUG_MSG("\tDest mac:\t%s\n", ether_ntoa((struct ether_addr*) eth->h_dest));
DEBUG_MSG("\tSrc mac:\t%s\n", ether_ntoa((struct ether_addr*) eth->h_source));
#else
DEBUG_CODE(char src_mac[18]; // ether_ntoa missing on some platforms
char dst_mac[18];
uint8_t* p = (uint8_t*) eth->h_source;
snprintf(
src_mac,
sizeof(src_mac),
"%02x:%02x:%02x:%02x:%02x:%02x",
p[0],
p[1],
p[2],
p[3],
p[4],
p[5]);
p = (uint8_t*) eth->h_dest;
snprintf(
dst_mac,
sizeof(dst_mac),
"%02x:%02x:%02x:%02x:%02x:%02x",
p[0],
p[1],
p[2],
p[3],
p[4],
p[5]););
DEBUG_CODE(
char src_mac[18]; // ether_ntoa missing on some platforms
char dst_mac[18];
uint8_t* p = (uint8_t*) eth->h_source;
snprintf(
src_mac,
sizeof(src_mac),
"%02x:%02x:%02x:%02x:%02x:%02x",
p[0],
p[1],
p[2],
p[3],
p[4],
p[5]);
p = (uint8_t*) eth->h_dest;
snprintf(
dst_mac,
sizeof(dst_mac),
"%02x:%02x:%02x:%02x:%02x:%02x",
p[0],
p[1],
p[2],
p[3],
p[4],
p[5]););
DEBUG_MSG("\tDest mac:\t%s\n", dst_mac);
DEBUG_MSG("\tSrc mac:\t%s\n", src_mac);
#endif
Expand Down Expand Up @@ -684,8 +685,9 @@ void parse_packet(
uint16_t data_offset = 0;

DEBUG_MSG("---------- packet parser #%u -------------\n", ++s_total_pkts);
DEBUG_CODE(char timestamp[32]; time_t time = ts.tv_sec;
strftime(timestamp, sizeof(timestamp), "%FT%T", localtime(&time)););
DEBUG_CODE(
char timestamp[32]; time_t time = ts.tv_sec;
strftime(timestamp, sizeof(timestamp), "%FT%T", localtime(&time)););
DEBUG_MSG("Time:\t\t\t%s.%06lu\n", timestamp, ts.tv_usec);
DEBUG_MSG("Packet length:\t\tcaplen=%uB len=%uB\n\n", caplen, len);

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/storage/cache/src/xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ XXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align)
len -= 8;
}
if (len >= 4) {
hash ^= (xxh_u64) (XXH_get32bits(ptr)) *XXH_PRIME64_1;
hash ^= (xxh_u64) (XXH_get32bits(ptr)) * XXH_PRIME64_1;
ptr += 4;
hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
len -= 4;
Expand Down