chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-dhcp6-lease: Add helper function to compute remaining expiry time
[elogind.git]
/
src
/
libsystemd-network
/
test-dhcp-client.c
diff --git
a/src/libsystemd-network/test-dhcp-client.c
b/src/libsystemd-network/test-dhcp-client.c
index 599bda1a5ee8f597af49c8687cace93e7ee8e025..450b6d4d3c9bfc199b4297e5d768574009ee7cd6 100644
(file)
--- a/
src/libsystemd-network/test-dhcp-client.c
+++ b/
src/libsystemd-network/test-dhcp-client.c
@@
-128,7
+128,7
@@
static void test_checksum(void)
if (verbose)
printf("* %s\n", __FUNCTION__);
if (verbose)
printf("* %s\n", __FUNCTION__);
- assert_se(dhcp_packet_checksum(&buf, 20) == be16toh(0x78ae));
+ assert_se(dhcp_packet_checksum(
(uint8_t*)
&buf, 20) == be16toh(0x78ae));
}
static int check_options(uint8_t code, uint8_t len, const uint8_t *option,
}
static int check_options(uint8_t code, uint8_t len, const uint8_t *option,
@@
-175,13
+175,13
@@
int dhcp_network_send_raw_socket(int s, const union sockaddr_union *link,
discover->ip.ttl = 0;
discover->ip.check = discover->udp.len;
discover->ip.ttl = 0;
discover->ip.check = discover->udp.len;
- udp_check = ~dhcp_packet_checksum(&discover->ip.ttl, len - 8);
+ udp_check = ~dhcp_packet_checksum(
(uint8_t*)
&discover->ip.ttl, len - 8);
assert_se(udp_check == 0xffff);
discover->ip.ttl = IPDEFTTL;
discover->ip.check = ip_check;
assert_se(udp_check == 0xffff);
discover->ip.ttl = IPDEFTTL;
discover->ip.check = ip_check;
- ip_check = ~dhcp_packet_checksum(&discover->ip, sizeof(discover->ip));
+ ip_check = ~dhcp_packet_checksum(
(uint8_t*)
&discover->ip, sizeof(discover->ip));
assert_se(ip_check == 0xffff);
assert_se(discover->dhcp.xid);
assert_se(ip_check == 0xffff);
assert_se(discover->dhcp.xid);