Shaper code cleanup

This commit is contained in:
Luca Deri 2016-12-05 13:00:02 +01:00
parent ebf5462491
commit 5cee98a65c
9 changed files with 69 additions and 67 deletions

View file

@ -165,7 +165,6 @@ static void* packetPollLoop(void* ptr) {
if((rc = pcap_next_ex(pd, &hdr, &pkt)) > 0) {
if((rc > 0) && (pkt != NULL) && (hdr->caplen > 0)) {
u_int16_t p;
bool shaped;
#ifdef WIN32
/*
@ -182,10 +181,10 @@ static void* packetPollLoop(void* ptr) {
hdr_copy.len = min(hdr->len, sizeof(pkt_copy) - 1);
hdr_copy.caplen = min(hdr_copy.len, hdr_copy.caplen);
memcpy(pkt_copy, pkt, hdr_copy.len);
iface->dissectPacket(&hdr_copy, (const u_char*)pkt_copy, &shaped, &p);
iface->dissectPacket(&hdr_copy, (const u_char*)pkt_copy, &p);
#else
hdr->caplen = min_val(hdr->caplen, iface->getMTU());
iface->dissectPacket(hdr, pkt, &shaped, &p);
iface->dissectPacket(hdr, pkt, &p);
#endif
}
} else if(rc < 0) {