Mercurial > hg > dhcpcd
changeset 2716:cb99895aeffb draft
Fix an impossible clang analyser warning.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sat, 27 Sep 2014 02:22:34 +0000 |
| parents | 393ea2479ef7 |
| children | 84d3fb71b565 |
| files | dhcpcd.c |
| diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/dhcpcd.c Sat Sep 27 00:50:18 2014 +0000 +++ b/dhcpcd.c Sat Sep 27 02:22:34 2014 +0000 @@ -454,7 +454,7 @@ } #ifdef INET6 - if (ifo->ia == NULL && ifo->options & DHCPCD_IPV6) { + if (ifo->ia_len == 0 && ifo->options & DHCPCD_IPV6) { ifo->ia = malloc(sizeof(*ifo->ia)); if (ifo->ia == NULL) syslog(LOG_ERR, "%s: %m", __func__); @@ -468,9 +468,11 @@ } } else { for (i = 0; i < ifo->ia_len; i++) { - if (!ifo->ia[i].iaid_set) - memcpy(ifo->ia->iaid, ifo->iaid, - sizeof(ifo->iaid)); + if (!ifo->ia[i].iaid_set) { + memcpy(&ifo->ia[i].iaid, ifo->iaid, + sizeof(ifo->ia[i].iaid)); + ifo->ia[i].iaid_set = 1; + } } } #endif
