aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/mgcp.c
diff options
context:
space:
mode:
authorlns <matzeton@googlemail.com>2023-10-10 15:53:29 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-10-11 15:53:29 +0200
commit4768d54ea95e691392ef99171fd478a26187e911 (patch)
tree89cf6978b7d28485c431bb2c58f0bd7275a84627 /src/lib/protocols/mgcp.c
parent77e5daf03e1ee7a8377a5a8906fe2c089c94ecf0 (diff)
Improved MGCP detection by allowing '\r' as line feed.improved/mgcp-line-feed
Signed-off-by: lns <matzeton@googlemail.com> Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/mgcp.c')
-rw-r--r--src/lib/protocols/mgcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/protocols/mgcp.c b/src/lib/protocols/mgcp.c
index a27959fb6..876325bd3 100644
--- a/src/lib/protocols/mgcp.c
+++ b/src/lib/protocols/mgcp.c
@@ -1,7 +1,7 @@
/*
* mgcp.c
*
- * Copyright (C) 2017-22 - ntop.org
+ * Copyright (C) 2017-23 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
@@ -50,7 +50,9 @@ static void ndpi_search_mgcp(struct ndpi_detection_module_struct *ndpi_struct, s
if (packet->payload_packet_len < 8) break;
/* packet must end with 0x0d0a or with 0x0a */
- if (packet->payload[packet->payload_packet_len - 1] != 0x0a) break;
+ if (packet->payload[packet->payload_packet_len - 1] != 0x0a &&
+ packet->payload[packet->payload_packet_len - 1] != 0x0d)
+ break;
if (packet->payload[0] != 'A' && packet->payload[0] != 'C' && packet->payload[0] != 'D' &&
packet->payload[0] != 'E' && packet->payload[0] != 'M' && packet->payload[0] != 'N' &&