aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2022-05-28 16:31:35 +0200
committerGitHub <noreply@github.com>2022-05-28 16:31:35 +0200
commitcfd23e88198716d8d5b3625a7da586536701349f (patch)
tree0c92d7db0f310d4e59cf3111613817bc87b187ae /src
parent77dc884a4c5dbe5111a6723d64c9e8b1a57c40b3 (diff)
Fixed HTTP lower/upper protocol mess for Aimini/IPP. (#1557)
* If HTTP was already detected, there is no need to overwrite the detection again Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/protocols/aimini.c2
-rw-r--r--src/lib/protocols/http.c11
-rw-r--r--src/lib/protocols/ipp.c2
3 files changed, 2 insertions, 13 deletions
diff --git a/src/lib/protocols/aimini.c b/src/lib/protocols/aimini.c
index c0d8327a9..2c42b1a41 100644
--- a/src/lib/protocols/aimini.c
+++ b/src/lib/protocols/aimini.c
@@ -33,7 +33,7 @@
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_AIMINI, NDPI_CONFIDENCE_DPI);
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
}
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 1b3ea7f66..6351e50aa 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -748,11 +748,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
}
}
-#if 0
- if(flow->http_detected)
- ndpi_http_parse_subprotocol(ndpi_struct, flow);
-#endif
-
if(flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN)
flow->guessed_protocol_id = NDPI_PROTOCOL_HTTP;
@@ -1297,12 +1292,6 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
return;
}
- /* If we already detected the HTTP request, we can add the connection and then check for the sub-protocol */
- if(flow->http_detected) {
- NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
- ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_WEB);
- }
-
/* Parse packet line and we look for the subprotocols */
ndpi_parse_packet_line_info(ndpi_struct, flow);
check_content_type_and_change_protocol(ndpi_struct, flow);
diff --git a/src/lib/protocols/ipp.c b/src/lib/protocols/ipp.c
index 546bfaea3..b88b52708 100644
--- a/src/lib/protocols/ipp.c
+++ b/src/lib/protocols/ipp.c
@@ -32,7 +32,7 @@
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_IPP, NDPI_CONFIDENCE_DPI);
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
}
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)