diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-08-30 18:31:21 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-08-30 18:42:20 -0400 |
commit | 44481a8b537839cd9ffead4d261491641f5b5260 (patch) | |
tree | f7c470f7aee00423c1603ef009243395639ac7c2 /src/libsystemd-network/test-dhcp6-client.c | |
parent | d182960ae974a0074010a058d0d909846a2f3f79 (diff) |
sd-dhcp6-client: properly calculate buffer size when parsing options
Also make pointer calculations more explicit so they are
easier to understand.
Diffstat (limited to 'src/libsystemd-network/test-dhcp6-client.c')
-rw-r--r-- | src/libsystemd-network/test-dhcp6-client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index 259db33bcd..d102a796b4 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -205,7 +205,7 @@ static uint8_t msg_reply[173] = { static int test_advertise_option(sd_event *e) { _cleanup_dhcp6_lease_free_ sd_dhcp6_lease *lease = NULL; DHCP6Message *advertise = (DHCP6Message *)msg_advertise; - uint8_t *optval, *opt = &msg_advertise[sizeof(DHCP6Message)]; + uint8_t *optval, *opt = msg_advertise + sizeof(DHCP6Message); uint16_t optcode; size_t optlen, len = sizeof(msg_advertise) - sizeof(DHCP6Message); be32_t val; |