From 95e16872fadfc98256fdcf729f267237c727e4c3 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Fri, 29 Jul 2022 12:07:14 +0200 Subject: First step in simplify `ndpi_process_extra_packet()` (#1680) Move the prottocol specific logic into the proper dissector code, where it belongs. Next step: remove that list of protocols. Long goal: remove this function altogether... --- src/lib/protocols/mail_pop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/protocols/mail_pop.c') diff --git a/src/lib/protocols/mail_pop.c b/src/lib/protocols/mail_pop.c index ad5b30a1c..e061e2cc8 100644 --- a/src/lib/protocols/mail_pop.c +++ b/src/lib/protocols/mail_pop.c @@ -46,6 +46,7 @@ static void ndpi_int_mail_pop_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { + NDPI_LOG_INFO(ndpi_struct, "mail_pop identified\n"); flow->guessed_protocol_id = NDPI_PROTOCOL_UNKNOWN; /* Avoid POP3S to be used s sub-protocol */ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI); } @@ -185,12 +186,12 @@ void ndpi_search_mail_pop_tcp(struct ndpi_detection_module_struct if((bit_count + flow->l4.tcp.mail_pop_stage) >= 3) { if(flow->l4.tcp.mail_pop_stage > 0) { - NDPI_LOG_INFO(ndpi_struct, "mail_pop identified\n"); if((flow->l4.tcp.ftp_imap_pop_smtp.password[0] != '\0') || (flow->l4.tcp.mail_pop_stage > 3)) { ndpi_int_mail_pop_add_connection(ndpi_struct, flow); - popInitExtraPacketProcessing(flow); + if(flow->l4.tcp.ftp_imap_pop_smtp.password[0] == '\0') + popInitExtraPacketProcessing(flow); } } -- cgit v1.2.3