diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2022-09-12 20:27:59 +0200 |
---|---|---|
committer | Toni <matzeton@googlemail.com> | 2022-09-13 20:48:20 +0200 |
commit | eea3c448de75bcb63f505957fbcbf4e36a3b8d88 (patch) | |
tree | 78ab51a1647123a8a43576ec9ddcf55196ed6e60 /src/lib/protocols/http.c | |
parent | 973950d8812ba58d6c72ea58badbd62e5152ff07 (diff) |
HTTP: remove some wrong code
This code seems wrong or in the wrong place, at least:
* "classification by port" and "classification by ip" protocols (i.e
"guessed" protocols) should be used to set the protocol stack only after
trying all the dissectors, and only by the generic code
* there are no reason (for a dissector) to update the "guessed"
information using the protocol stack values: it is usually the other way
around (see previous point)
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 5a088c7c8..dd494702a 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -751,28 +751,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ ndpi_check_dga_name(ndpi_struct, flow, flow->host_server_name, 1, 0); } - /** - check result of host subprotocol detection - - if "detected" in flow == 0 then "detected" = "guess" - else "guess" = "detected" - **/ - if(flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) { - /* Avoid putting as subprotocol a "core" protocol such as SSL or DNS */ - if(ndpi_struct->proto_defaults[flow->guessed_protocol_id].subprotocol_count == 0) { - if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN && - flow->guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN) { - ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, flow->guessed_protocol_id, NDPI_CONFIDENCE_DPI); - } - } - } - else { - if(flow->detected_protocol_stack[1] != flow->guessed_protocol_id) - flow->guessed_protocol_id = flow->detected_protocol_stack[1]; - if(flow->detected_protocol_stack[0] != flow->guessed_host_protocol_id) - flow->guessed_host_protocol_id = flow->detected_protocol_stack[0]; - } - if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) && (flow->http_detected) && (packet->http_origin.len > 0)) { |