mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-23 10:06:42 +08:00
linux: Fix compile warning using clang
This commit is contained in:
parent
fdcf878fff
commit
01b9b37dd8
@ -1110,17 +1110,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);
|
||||
|
Loading…
Reference in New Issue
Block a user