Skip to content

Commit

Permalink
Change TCP Window Size based on SrcPort, not DstPort.
Browse files Browse the repository at this point in the history
When HTTPS fragment size was set, the program always used it for HTTP, even
if HTTP fragmentation was disabled. This is due to a bug which checked DstPort,
not SrcPort, and the packets passed DstPort != htons(80) HTTPS check.
  • Loading branch information
ValdikSS committed Jun 11, 2017
1 parent 2a5e4a0 commit f5ac7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions goodbyedpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ int main(int argc, char *argv[]) {
if (addr.Direction == WINDIVERT_DIRECTION_INBOUND &&
ppTcpHdr->Syn == 1) {
//printf("Changing Window Size!\n");
if (do_fragment_http && ppTcpHdr->DstPort == htons(80)) {
if (do_fragment_http && ppTcpHdr->SrcPort == htons(80)) {
change_window_size(packet, http_fragment_size);
WinDivertHelperCalcChecksums(packet, packetLen, 0);
}
else if (do_fragment_https && ppTcpHdr->DstPort != htons(80)) {
else if (do_fragment_https && ppTcpHdr->SrcPort != htons(80)) {
change_window_size(packet, https_fragment_size);
WinDivertHelperCalcChecksums(packet, packetLen, 0);
}
Expand Down

0 comments on commit f5ac7c0

Please sign in to comment.