aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/fbzero.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/fbzero.c')
-rw-r--r--src/lib/protocols/fbzero.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/protocols/fbzero.c b/src/lib/protocols/fbzero.c
index 31acd0c9a..6c818e3c7 100644
--- a/src/lib/protocols/fbzero.c
+++ b/src/lib/protocols/fbzero.c
@@ -22,8 +22,6 @@
/* https://code.facebook.com/posts/608854979307125/building-zero-protocol-for-fast-secure-mobile-connections/ */
-#ifdef NDPI_PROTOCOL_FBZERO
-
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FBZERO
#include "ndpi_api.h"
@@ -86,7 +84,8 @@ void ndpi_search_fbzero(struct ndpi_detection_module_struct *ndpi_struct,
&& (t->tag[2] == 'I') && (t->tag[3] == '\0')) {
char *value = (char*)&packet->payload[data_offset + data_prev_offset];
u_int tag_len = t->tag_offset_len-data_prev_offset, max_len;
-
+ ndpi_protocol_match_result ret_match;
+
max_len = ndpi_min(tag_len, sizeof(flow->host_server_name)-1);
strncpy((char*)flow->host_server_name, value, max_len);
@@ -101,6 +100,7 @@ void ndpi_search_fbzero(struct ndpi_detection_module_struct *ndpi_struct,
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
strlen((const char *)flow->host_server_name),
+ &ret_match,
NDPI_PROTOCOL_FBZERO);
return;
}
@@ -129,4 +129,3 @@ void init_fbzero_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
*id += 1;
}
-#endif