-
Notifications
You must be signed in to change notification settings - Fork 434
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
fix(tcpdump): partial checksum #1015
base: main
Are you sure you want to change the base?
Conversation
src/wire/ip.rs
Outdated
let partially_valid = udp_packet | ||
.verify_partial_checksum(&repr.src_addr(), &repr.dst_addr()); | ||
|
||
format_checksum(f, valid || partially_valid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer different formatting for valid vs partially valid checksum, since this is a diagnostic interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified the message when the partial checksum is correct.
8ec1376
to
a3abf9c
Compare
In some cases, the checksum calculation is offloaded to hardware and only the partial checksum is calculated (only the pseudo-header). The tcpdump example was not taking this into account and was flagging some packets with incorrect checksums.
a3abf9c
to
dff1c20
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1015 +/- ##
==========================================
+ Coverage 80.75% 80.77% +0.01%
==========================================
Files 81 81
Lines 28340 28415 +75
==========================================
+ Hits 22887 22953 +66
- Misses 5453 5462 +9 ☔ View full report in Codecov by Sentry. |
In some cases, the checksum calculation is offloaded to hardware and only the partial checksum is calculated (only the pseudo-header). The tcpdump example was not taking this into account and was flagging some packets with incorrect checksums.