diff --git a/src/lib/protocols/raknet.c b/src/lib/protocols/raknet.c index 6df9d0ecdaf..86e388a47fc 100644 --- a/src/lib/protocols/raknet.c +++ b/src/lib/protocols/raknet.c @@ -124,7 +124,9 @@ void ndpi_search_raknet(struct ndpi_detection_module_struct *ndpi_struct, case 0x07: /* Open Connection Request 2 */ ip_addr_offset = raknet_dissect_ip(packet, 17); - if (packet->payload_packet_len != 34 || ip_addr_offset == 0) + if (ip_addr_offset == 0 || + !((ip_addr_offset == 16 && packet->payload_packet_len == 46) || + (ip_addr_offset == 4 && packet->payload_packet_len == 34))) { NDPI_EXCLUDE_PROTO(ndpi_struct, flow); return; @@ -142,7 +144,9 @@ void ndpi_search_raknet(struct ndpi_detection_module_struct *ndpi_struct, case 0x08: /* Open Connection Reply 2 */ ip_addr_offset = raknet_dissect_ip(packet, 25); - if (packet->payload_packet_len != 35 || ip_addr_offset == 0) + if (ip_addr_offset == 0 || + !((ip_addr_offset == 16 && packet->payload_packet_len == 47) || + (ip_addr_offset == 4 && packet->payload_packet_len == 35))) { NDPI_EXCLUDE_PROTO(ndpi_struct, flow); return;