diff options
author | Luca <deri@ntop.org> | 2015-12-08 00:32:30 +0800 |
---|---|---|
committer | Luca <deri@ntop.org> | 2015-12-08 00:32:30 +0800 |
commit | 41c6d2d031110bd0d86599abe43229d4d14a2781 (patch) | |
tree | df1395d36039f837d99d226ff8008591e74d37e7 /example | |
parent | d2c355bdb060af8d25afc8fe43320c51ec920f32 (diff) |
Improvement for Dropbox detection
Fix for #124
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 0d473f58a..e2cc162fb 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1640,7 +1640,6 @@ static void pcap_packet_callback(u_char *args, datalink_check: switch(datalink_type) { - case DLT_NULL : if(ntohl(*((u_int32_t*)&packet[eth_offset])) == 2) type = ETH_P_IP; @@ -1725,7 +1724,12 @@ static void pcap_packet_callback(u_char *args, ip_offset = wifi_len + radio_len + sizeof(struct ndpi_llc_header) + eth_offset; break; + case DLT_RAW: + ip_offset = eth_offset = 0; + break; + default: + printf("Unknown datalink %d\n", datalink_type); return; } @@ -1735,9 +1739,7 @@ static void pcap_packet_callback(u_char *args, type = (packet[ip_offset+2] << 8) + packet[ip_offset+3]; ip_offset += 4; vlan_packet = 1; - } - else if(type == MPLS_UNI || type == MPLS_MULTI) { - + } else if(type == MPLS_UNI || type == MPLS_MULTI) { mpls = (struct ndpi_mpls_header *) &packet[ip_offset]; label = ntohl(mpls->label); /* label = ntohl(*((u_int32_t*)&packet[ip_offset])); */ |