nDPI sync.

This commit is contained in:
“Zied 2022-03-07 14:38:05 +01:00
parent ce416f0d3b
commit 8a003d3f79
2 changed files with 4 additions and 1 deletions

View file

@ -520,6 +520,7 @@ typedef enum {
struct ndpi_detection_module_struct {
NDPI_PROTOCOL_BITMASK detection_bitmask;
uint32_t current_ts;
uint16_t max_packets_to_process;
uint16_t num_tls_blocks_to_follow;
uint8_t skip_tls_blocks_until_change_cipher:1, enable_ja3_plus:1, _notused:6;
char custom_category_labels[NUM_CUSTOM_CATEGORIES][CUSTOM_CATEGORY_LABEL_LEN];

View file

@ -895,6 +895,7 @@ int packet_ether_type_checker(uint32_t caplen, const uint8_t *packet, uint16_t *
break;
case MPLS_UNI:
case MPLS_MULTI:
if (*ip_offset + 4 >= (int) caplen) return 0;
mpls.u32 = *((uint32_t *) &packet[(*ip_offset)]);
mpls.u32 = ntohl(mpls.u32);
(*type) = ETH_P_IP, (*ip_offset) += 4;
@ -1057,11 +1058,12 @@ int packet_process(int datalink_type, uint32_t caplen, uint32_t len, const uint8
tag_len = 1, stop = 1;
break;
default:
if (offset + 1 >= caplen) return 0;
tag_len = packet[offset+1];
break;
}
offset += tag_len;
if (offset + 1 >= caplen) return 0;
if (offset >= caplen) return 0;
else {
eth_offset = offset;
goto datalink_check;