Skip to content

Commit

Permalink
Merge pull request #92 from wllm-rbnt/dbg
Browse files Browse the repository at this point in the history
Set packet type for RAW PCAPs
  • Loading branch information
adulau authored Sep 13, 2023
2 parents ec887fb + 3408f9d commit d1037f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions base/pcap-snoop.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ void pcap_cb(u_char *ptr, const struct pcap_pkthdr *hdr, const u_char *data) {

switch(pcap_if_type) {
case DLT_RAW:
switch(((u_int8_t)*data) >> 4) {
case 4:
type = ETHERTYPE_IP;
break;
case 6:
type = ETHERTYPE_IPV6;
break;
default:
fprintf(stderr, "Unknown packet type, skipping ...\n");
return;
}
break;
#ifdef DLT_LOOP
case DLT_LOOP:
#endif
Expand Down

0 comments on commit d1037f8

Please sign in to comment.