forked from Mirrors/sngrep
capture: add support for VLAN 802.1Q header in Linux cooked packets #189
This commit is contained in:
parent
22b8206357
commit
e50176a534
|
@ -390,6 +390,17 @@ capture_packet_reasm_ip(capture_info_t *capinfo, const struct pcap_pkthdr *heade
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DLT_LINUX_SLL
|
||||
if (capinfo->link == DLT_LINUX_SLL) {
|
||||
struct sll_header *sll = (struct sll_header *) packet;
|
||||
if (ntohs(sll->sll_protocol) == ETHERTYPE_8021Q) {
|
||||
link_hl += 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Get IP header
|
||||
ip4 = (struct ip *) (packet + link_hl);
|
||||
|
||||
|
|
|
@ -68,6 +68,10 @@
|
|||
#include <netinet/ip6.h>
|
||||
#endif
|
||||
|
||||
#ifdef DLT_LINUX_SLL
|
||||
#include <pcap/sll.h>
|
||||
#endif
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <netinet/ip.h>
|
||||
|
|
Loading…
Reference in New Issue