From 50f23fbc02bd52bdc5cfd4fc9c0c6f177083efda Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 18 Jul 2019 00:31:11 +0200 Subject: [PATCH] Avoid void pointer arithmetic. --- src/route.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/route.c b/src/route.c index 2fa6175..d1048e7 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) { -- 2.25.1