-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
net_help: Cleanup #2019
net_help: Cleanup #2019
Conversation
The od module does the same, much less specialized, much more sophisticated.
Used nowhere; alternative: ipv6_addr_is_equal(), since other use-cases (is an IPv6 address smaller than the other) are not applicable anyway.
bf05c86
to
a404357
Compare
After testing this function I have to admit I really don't understand what this function does :/ |
@@ -44,13 +32,13 @@ uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len) | |||
buf += 2; | |||
sum += carry; | |||
sum += t; | |||
carry = (t > sum); | |||
carry = (t > sum) ? 1 : 0; |
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 find the original code more readable.
|
But at least in ICMP (where it is used to calculate the checksum, and where the checksum is [in most cases ;-)] correct according to wireshark) it's supposed to be
But I neither see the one's complement, nor is it the sum as I would expect a sum would look like. |
Reverted the negatively criticized changes. |
Remembered my telematics classes and the Internet Checksum. Updated the documentation accordingly. |
ACk. Squash and merge at will. |
387f355
to
c9219b8
Compare
In addition to #1984 this cleans up the
net_help
module.printArrayRange()
. Alternative: theod
moduleIPV6_CMP_ADDR()
. Alternative:ipv6_addr_is_equal()
/ipv6_addr_equal()
(as of WIP IPv6 refactoring #2003). Other comparisons between IPv6 addresses would be odd anywaycsum()
according to Coding Conventions tonet_help_csum()