Skip to content

Commit

Permalink
appneta#190 don't process frags for chksum_fix (appneta#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
fklassen authored Feb 28, 2017
1 parent d237106 commit e9b133e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add protection against packet drift by Guillaume Scott (#268)
- Include Travis-CI build support by Ilya Shipitsin (#264) (#285)
- First and last packet times in --stats output (#239)
- tcprewrite fix checksum properly for fragmented packets (#190)

11/19/2016 Version 4.1.2
- Fix compilation with musl C library (#260)
Expand Down
3 changes: 2 additions & 1 deletion src/tcpedit/edit_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ fix_ipv4_checksums(tcpedit_t *tcpedit, struct pcap_pkthdr *pkthdr, ipv4_hdr_t *i


/* calc the L4 checksum if we have the whole packet && not a frag or first frag */
if (pkthdr->caplen == pkthdr->len && (htons(ip_hdr->ip_off) & IP_OFFMASK) == 0) {
if (pkthdr->caplen == pkthdr->len &&
(htons(ip_hdr->ip_off) & (IP_MF | IP_OFFMASK)) == 0) {
ret1 = do_checksum(tcpedit, (u_char *) ip_hdr,
ip_hdr->ip_p, ntohs(ip_hdr->ip_len) - (ip_hdr->ip_hl << 2));
if (ret1 < 0)
Expand Down

0 comments on commit e9b133e

Please sign in to comment.