diff options
| author | Roy Marples <roy@marples.name> | 2014-09-27 02:22:34 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-09-27 02:22:34 +0000 |
| commit | f05b59c5f21021cb1eeffc982f4783585878a921 (patch) | |
| tree | 89192ebdd916ebb2ade76f2ae8809e1cdb636a05 /dhcpcd.c | |
| parent | b99d5e06e9d5c4be313d2d94db01ddf76990e302 (diff) | |
| download | dhcpcd-f05b59c5f21021cb1eeffc982f4783585878a921.tar.xz | |
Fix an impossible clang analyser warning.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -454,7 +454,7 @@ configure_interface1(struct interface *ifp) } #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 @@ configure_interface1(struct interface *ifp) } } 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 |
