From: Guus Sliepen Date: Wed, 17 Jul 2019 22:31:11 +0000 (+0200) Subject: Avoid void pointer arithmetic. X-Git-Tag: release-1.1pre18~26 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=50f23fbc02bd52bdc5cfd4fc9c0c6f177083efda;p=tinc Avoid void pointer arithmetic. --- diff --git a/src/route.c b/src/route.c index 2fa61751..d1048e76 100644 --- a/src/route.c +++ b/src/route.c @@ -63,7 +63,8 @@ static timeout_t age_subnets_timeout; /* RFC 1071 */ -static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) { +static uint16_t inet_checksum(void *vdata, int len, uint16_t prevsum) { + uint8_t *data = vdata; uint16_t word; uint32_t checksum = prevsum ^ 0xFFFF; @@ -75,7 +76,7 @@ static uint16_t inet_checksum(void *data, int len, uint16_t prevsum) { } if(len) { - checksum += *(uint8_t *)data; + checksum += *data; } while(checksum >> 16) {