aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorRenan de Souza <renan.souza@setinet.com.br>2019-10-29 14:59:18 -0300
committerRenan de Souza <renan.souza@setinet.com.br>2019-10-29 14:59:18 -0300
commitd619ba08572d1404970c04a0e65a39b75a69c78e (patch)
tree13af928b2399a0692383fdb3a7417a7b41cf9274 /example/reader_util.c
parentfbea243e563abe0799307afa939514af56e1bff0 (diff)
parentd2f04f5bdfe986082ca5e5f479a99e4c24a5a898 (diff)
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index e7ec81d3c..6cb150d87 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -123,7 +123,6 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
u_int16_t payload_len,
u_int32_t packet_id) {
struct payload_stats *ret;
- u_int i;
struct flow_id_stats *f;
struct packet_id_stats *p;
@@ -966,7 +965,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
}
}
/* HTTP */
- else if(flow->detected_protocol.master_protocol == NDPI_PROTOCOL_HTTP) {
+ else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_HTTP) {
if(flow->ndpi_flow->http.url != NULL) {
snprintf(flow->http.url, sizeof(flow->http.url), "%s", flow->ndpi_flow->http.url);
flow->http.response_status_code = flow->ndpi_flow->http.response_status_code;
@@ -1428,7 +1427,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
ip_offset += 4;
vlan_packet = 1;
// double tagging for 802.1Q
- if(type == 0x8100) {
+ while((type == 0x8100) && (ip_offset < header->caplen)) {
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
ip_offset += 4;