WinDivert 1.4 support

This commit is contained in:
ValdikSS 2018-07-19 21:28:32 +03:00
parent 38b1ff1a92
commit a028cb01f4

View File

@ -770,7 +770,7 @@ int main(int argc, char *argv[]) {
); );
WinDivertHelperCalcChecksums( WinDivertHelperCalcChecksums(
packet, packetLen - packet_dataLen + http_fragment_size, 0 packet, packetLen - packet_dataLen + http_fragment_size, &addr, 0
); );
WinDivertSend( WinDivertSend(
w_filter, packet, w_filter, packet,
@ -975,11 +975,7 @@ int main(int argc, char *argv[]) {
if (should_reinject) { if (should_reinject) {
//printf("Re-injecting!\n"); //printf("Re-injecting!\n");
if (should_recalc_checksum) { if (should_recalc_checksum) {
WinDivertHelperCalcChecksums(packet, packetLen, 0); WinDivertHelperCalcChecksums(packet, packetLen, &addr, NULL);
}
else {
WinDivertHelperCalcChecksums(packet, packetLen,
WINDIVERT_HELPER_NO_REPLACE);
} }
WinDivertSend(w_filter, packet, packetLen, &addr, NULL); WinDivertSend(w_filter, packet, packetLen, &addr, NULL);
} }