projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable AutoConnect in the ns-ping test.
[tinc]
/
src
/
route.c
diff --git
a/src/route.c
b/src/route.c
index
2e8d94a
..
d1048e7
100644
(file)
--- a/
src/route.c
+++ b/
src/route.c
@@
-63,17
+63,20
@@
static timeout_t age_subnets_timeout;
/* RFC 1071 */
/* RFC 1071 */
-static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) {
- uint16_t *p = data;
+static uint16_t inet_checksum(void *vdata, int len, uint16_t prevsum) {
+ uint8_t *data = vdata;
+ uint16_t word;
uint32_t checksum = prevsum ^ 0xFFFF;
while(len >= 2) {
uint32_t checksum = prevsum ^ 0xFFFF;
while(len >= 2) {
- checksum += *p++;
+ memcpy(&word, data, sizeof(word));
+ checksum += word;
+ data += 2;
len -= 2;
}
if(len) {
len -= 2;
}
if(len) {
- checksum += *
(uint8_t *)p
;
+ checksum += *
data
;
}
while(checksum >> 16) {
}
while(checksum >> 16) {