From: Roy Marples Date: Mon, 9 Jan 2023 10:09:45 +0000 (+0000) Subject: linux: Fix compile warning using clang X-Git-Tag: v9.5.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05c08db6257df614b17dece015c323e7df2c5bd8;p=thirdparty%2Fdhcpcd.git linux: Fix compile warning using clang --- diff --git a/src/privsep-root.c b/src/privsep-root.c index 57226f0d..67504e72 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -995,17 +995,17 @@ ps_root_getifaddrs(struct dhcpcd_ctx *ctx, struct ifaddrs **ifahead) len -= ALIGN(sizeof(*ifa)) + ALIGN(IFNAMSIZ) + ALIGN(sizeof(salen) * IFA_NADDRS); -#define COPYOUTSA(addr) \ - do { \ - memcpy(&salen, sap, sizeof(salen)); \ - if (len < salen) \ - goto err; \ - if (salen != 0) { \ - (addr) = (struct sockaddr *)bp; \ - bp += ALIGN(salen); \ - len -= ALIGN(salen); \ - } \ - sap += sizeof(salen); \ +#define COPYOUTSA(addr) \ + do { \ + memcpy(&salen, sap, sizeof(salen)); \ + if (len < salen) \ + goto err; \ + if (salen != 0) { \ + (addr) = (struct sockaddr *)(void *)bp; \ + bp += ALIGN(salen); \ + len -= ALIGN(salen); \ + } \ + sap += sizeof(salen); \ } while (0 /* CONSTCOND */) COPYOUTSA(ifa->ifa_addr);