summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp6-lease.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-10-08 11:00:07 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2014-10-09 14:57:53 +0300
commitee3a5027f7c56df2ef47a774970433d7045c9e9f (patch)
tree8c4d53fb9be2f55479705da8920cb5c14c653e30 /src/libsystemd-network/sd-dhcp6-lease.c
parentd46fbfb48deff83943355992e55f9ef4431ff5ef (diff)
sd-dhcp6-lease: Name the structure containing IAADDR data
With this change the DHCP6_OPTION_IAADDR_LEN define can be removed in favor of using sizeof(). Using the name of the struct and sizeof() makes it clearer how much and what data is being copied from the DHCPv6 message.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp6-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-lease.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c
index b9d0503642..e2715ea659 100644
--- a/src/libsystemd-network/sd-dhcp6-lease.c
+++ b/src/libsystemd-network/sd-dhcp6-lease.c
@@ -41,7 +41,7 @@ int dhcp6_lease_ia_rebind_expire(const DHCP6IA *ia, uint32_t *expire) {
assert_return(expire, -EINVAL);
LIST_FOREACH(addresses, addr, ia->addresses) {
- t = be32toh(addr->lifetime_valid);
+ t = be32toh(addr->iaaddr.lifetime_valid);
if (valid < t)
valid = t;
}
@@ -156,9 +156,11 @@ int sd_dhcp6_lease_get_next_address(sd_dhcp6_lease *lease,
if (!lease->addr_iter)
return -ENOMSG;
- memcpy(addr, &lease->addr_iter->address, sizeof(struct in6_addr));
- *lifetime_preferred = be32toh(lease->addr_iter->lifetime_preferred);
- *lifetime_valid = be32toh(lease->addr_iter->lifetime_valid);
+ memcpy(addr, &lease->addr_iter->iaaddr.address,
+ sizeof(struct in6_addr));
+ *lifetime_preferred =
+ be32toh(lease->addr_iter->iaaddr.lifetime_preferred);
+ *lifetime_valid = be32toh(lease->addr_iter->iaaddr.lifetime_valid);
lease->addr_iter = lease->addr_iter->addresses_next;