You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
If this library is executed on arduino, then an error often occurs in the checksum calculation function( _checksum ).
In this place:
...
sum += *time + *(time + 1);
...
If the sum of two 16-bit numbers is more than the 16-bit number can hold, then the most significant bits of the sum are lost.
This line should be replaced with:
sum += *time;
sum += *(time + 1);
Then the sum of the 32 bit and 16 bit number is stored in a 32 bit number.
Or not use time in the icmp packet constructor:
ICMPEcho :: ICMPEcho (uint8_t type, uint16_t _id, uint16_t _seq, uint8_t * _payload): seq (_seq), id (_id), time (0)
The text was updated successfully, but these errors were encountered:
Hi.
If this library is executed on arduino, then an error often occurs in the checksum calculation function( _checksum ).
In this place:
...
sum += *time + *(time + 1);
...
If the sum of two 16-bit numbers is more than the 16-bit number can hold, then the most significant bits of the sum are lost.
This line should be replaced with:
sum += *time;
sum += *(time + 1);
Then the sum of the 32 bit and 16 bit number is stored in a 32 bit number.
Or not use time in the icmp packet constructor:
ICMPEcho :: ICMPEcho (uint8_t type, uint16_t _id, uint16_t _seq, uint8_t * _payload): seq (_seq), id (_id), time (0)
The text was updated successfully, but these errors were encountered: