mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Revert "Disable TPACKET v3 to prevent packets reordering in root mode"
This reverts commit f715c06be1.
Further testing comparing the dumps produced by simultaneuosly running
PCAPdroid in non-immediate mode with tcpdump in immediate mode has
shown that packets reordering can also occur in immediate mode, so
it does not depend on TPACKET v3.
This commit is contained in:
parent
f715c06be1
commit
e1bafef088
@ -417,19 +417,7 @@ static int open_interface(pcapd_iface_t *iface, pcapd_runtime_t *rt, const char
|
||||
/* The snaplen includes the datalink overhead. Max datalink overhead (SLL2): 20 B */
|
||||
int snaplen = mtu + SLL2_HDR_LEN;
|
||||
|
||||
// pcap_set_immediate_mode necessary to avoid using TPACKET v3, which sometimes causes packets
|
||||
// reordering in the capture
|
||||
pcap_t *pd;
|
||||
if(!(pd = pcap_create(ifname, errbuf)) ||
|
||||
pcap_set_immediate_mode(pd, 1) ||
|
||||
pcap_set_snaplen(pd, snaplen) ||
|
||||
pcap_activate(pd)) {
|
||||
if(pd) {
|
||||
pcap_close(pd);
|
||||
pd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
pcap_t *pd = pcap_open_live(ifname, snaplen, 0, 1, errbuf);
|
||||
if(!pd) {
|
||||
// try to open as file
|
||||
pd = pcap_open_offline(ifname, errbuf);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user