Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite zero IPv4 total length field to match the actual packet length #406

Closed
diper opened this issue Jun 27, 2017 · 7 comments
Closed

Comments

@diper
Copy link

diper commented Jun 27, 2017

It is possible?

@fklassen
Copy link
Member

It's possible. Is there a need for it? How would it be used?

@diper
Copy link
Author

diper commented Jun 28, 2017

This is needed for fixing pcap files captured with TCP segmentation offloading. Like done in #247

@fklassen
Copy link
Member

Sounds good. Will schedule work for a future release. Right now we are in a code freeze. Will probably start enhancements again in the Fall.

fklassen added a commit that referenced this issue Jan 22, 2018
fklassen added a commit that referenced this issue Jan 22, 2018
@fklassen
Copy link
Member

Fixed in PR #452

@diper
Copy link
Author

diper commented Feb 21, 2018

Feature seem to be broken...
Before
image
After rewrite
image

7179 == ntohs(2844) where 2844 is a frame size

@fklassen fklassen reopened this Feb 21, 2018
fklassen added a commit that referenced this issue Oct 19, 2018
* Enhancement_#493_codacy_fixes: (26 commits)
  Enhancement #493 - fixes for Codacy identified issues
  Bug #486 Enforce max snaplen rather than doing realloc
  Bug #486 CVE-2018-17974 realloc memory if packet size increases
  Bug #484 CVE-2018-17582 Check for corrupt PCAP files
  4.3 - revert travis updates from merge
  Remove dead code
  resolve possible null pointer dereference
  travis-ci: add autogen package
  Bug #461 build warnings (#462)
  #412 fix gcc 6.3 compiler warning
  #421 fix ms to ns conversion
  Bug #423 remove commented code
  Bug #423 Remove limit for tcpprep -S
  Bug #398 Rewrite of tcpdump.c (#457)
  Bug #402 memset dlt radiotap get 80211 (#454)
  #404 fix check_list return values (#453)
  #406 fix zero-length IP headers
  #416 apply STDIN restore to all programs
  #416 fix compile issue introduced by downstream PR
  #416 update CHANGELOG [ci skip]
  ...
fklassen added a commit that referenced this issue Oct 21, 2018
…_len

Bug #406 change packet length to network order
@fklassen
Copy link
Member

fixed latest bug in PR #501

fklassen added a commit that referenced this issue Oct 23, 2018
* 4.3: (22 commits)
  Bug #418 don't ignore 2nd packet timing
  Bug #411 allow TAP on all platforms
  Bug #174 ensure --with-testnic does not affect replay
  Bug #406 change packet length to network order
  Bug #413 fix manpage typos
  Bug #485 Heap overflow fixed in #484
  Enhancement_#482 update CHANGELOG/CREDITS
  Enhancement_#482 test Makefile merge error fixup
  Enhancement_#482 test Makefile cleanup
  Bug #489 free after memcpy
  Bug #488 heap overflow csum replace4 (#496)
  Bug #486 CVE-2018-17974 realloc memory if packet size increases (#492)
  Enhancement #493 - fixes for Codacy identified issues
  Bug #486 Enforce max snaplen rather than doing realloc
  Bug #486 CVE-2018-17974 realloc memory if packet size increases
  Bug #484 CVE-2018-17582 Check for corrupt PCAP files
  4.3 - revert travis updates from merge
  Simplify plugin Makefiles
  allow out-of-tree build
  Remove dead code
  ...
fklassen added a commit that referenced this issue Oct 23, 2018
…ging

* 4.3: (36 commits)
  Enhancement #506 disable C99 and fix warnings (#507)
  Bug #418 don't ignore 2nd packet timing
  Bug #411 allow TAP on all platforms
  Bug #174 ensure --with-testnic does not affect replay
  Bug #406 change packet length to network order
  Bug #413 fix manpage typos
  Bug #485 Heap overflow fixed in #484
  Enhancement_#482 update CHANGELOG/CREDITS
  Enhancement_#482 test Makefile merge error fixup
  Enhancement_#482 test Makefile cleanup
  Bug #489 free after memcpy
  Bug #488 heap overflow csum replace4 (#496)
  Bug #486 CVE-2018-17974 realloc memory if packet size increases (#492)
  Enhancement #493 - fixes for Codacy identified issues
  Bug #486 Enforce max snaplen rather than doing realloc
  Bug #486 CVE-2018-17974 realloc memory if packet size increases
  Bug #484 CVE-2018-17582 Check for corrupt PCAP files
  4.3 - revert travis updates from merge
  Simplify plugin Makefiles
  allow out-of-tree build
  ...
@1wilkens
Copy link

I think the feature is still broken, as it incorrectly set the IP length to the total length which is not correct as the Link Layer header length needs to be deducted (14 byte for Ethernet).

Before rewriting:
Before rewriting
After rewriting:
After Rewriting

I could whip up a PR however, due to the modularity of tcprewrite regarding Layer 2 types, I am not sure where to get the correct length from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants