mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-23 18:14:09 +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)) +
|
len -= ALIGN(sizeof(*ifa)) +
|
||||||
ALIGN(IFNAMSIZ) + ALIGN(sizeof(salen) * IFA_NADDRS);
|
ALIGN(IFNAMSIZ) + ALIGN(sizeof(salen) * IFA_NADDRS);
|
||||||
|
|
||||||
#define COPYOUTSA(addr) \
|
#define COPYOUTSA(addr) \
|
||||||
do { \
|
do { \
|
||||||
memcpy(&salen, sap, sizeof(salen)); \
|
memcpy(&salen, sap, sizeof(salen)); \
|
||||||
if (len < salen) \
|
if (len < salen) \
|
||||||
goto err; \
|
goto err; \
|
||||||
if (salen != 0) { \
|
if (salen != 0) { \
|
||||||
(addr) = (struct sockaddr *)bp; \
|
(addr) = (struct sockaddr *)(void *)bp; \
|
||||||
bp += ALIGN(salen); \
|
bp += ALIGN(salen); \
|
||||||
len -= ALIGN(salen); \
|
len -= ALIGN(salen); \
|
||||||
} \
|
} \
|
||||||
sap += sizeof(salen); \
|
sap += sizeof(salen); \
|
||||||
} while (0 /* CONSTCOND */)
|
} while (0 /* CONSTCOND */)
|
||||||
|
|
||||||
COPYOUTSA(ifa->ifa_addr);
|
COPYOUTSA(ifa->ifa_addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user