aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/ndpiReader.c10
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])); */