summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-09-27 02:22:34 +0000
committerRoy Marples <roy@marples.name>2014-09-27 02:22:34 +0000
commitf05b59c5f21021cb1eeffc982f4783585878a921 (patch)
tree89192ebdd916ebb2ade76f2ae8809e1cdb636a05 /dhcpcd.c
parentb99d5e06e9d5c4be313d2d94db01ddf76990e302 (diff)
downloaddhcpcd-f05b59c5f21021cb1eeffc982f4783585878a921.tar.xz
Fix an impossible clang analyser warning.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 6d83a149..240bd454 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -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