chiark / gitweb /
service: minor modernization
[elogind.git] / src / libsystemd-network / test-dhcp-client.c
index 83dd6194076db22cea5cfca9c2074493c5e1a8b8..7cbe10d5a7a632936382829c08d449dac85e9613 100644 (file)
@@ -128,7 +128,7 @@ static void test_checksum(void)
         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,
@@ -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;
 
-        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;
 
-        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);
@@ -196,7 +196,7 @@ int dhcp_network_send_raw_socket(int s, const union sockaddr_union *link,
         return 575;
 }
 
-int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t id)
+int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t id, struct ether_addr mac)
 {
         if (socketpair(AF_UNIX, SOCK_STREAM, 0, test_fd) < 0)
                 return -errno;
@@ -204,7 +204,7 @@ int dhcp_network_bind_raw_socket(int index, union sockaddr_union *link, uint32_t
         return test_fd[0];
 }
 
-int dhcp_network_bind_udp_socket(int index, be32_t address, uint16_t port)
+int dhcp_network_bind_udp_socket(be32_t address, uint16_t port)
 {
         return 0;
 }