diff options
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index d014da328..43c1c489f 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6682,7 +6682,7 @@ int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_str, rc = ndpi_match_string_common(((AC_AUTOMATA_t *) automa->ac_automa), string_to_match,string_to_match_len, &ret_match->protocol_id, &ret_match->protocol_category, &ret_match->protocol_breed); - return rc < 0 ? NDPI_PROTOCOL_UNKNOWN : ret_match->protocol_id; + return rc < 0 ? rc : ret_match->protocol_id; } /* **************************************** */ @@ -6709,12 +6709,15 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu struct ndpi_flow_struct *flow, char *string_to_match, u_int string_to_match_len, u_int16_t master_protocol_id, ndpi_protocol_match_result *ret_match, u_int8_t is_host_match) { - uint16_t matching_protocol_id; + int matching_protocol_id; struct ndpi_packet_struct *packet = &flow->packet; matching_protocol_id = ndpi_match_string_subprotocol(ndpi_str, string_to_match, string_to_match_len, ret_match, is_host_match); + if(matching_protocol_id < 0) + return NDPI_PROTOCOL_UNKNOWN; + #ifdef DEBUG { char m[256]; |