summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-server.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-25 20:39:02 +0200
committerTom Gundersen <teg@jklm.no>2014-06-13 17:07:19 +0200
commitbd57b45029ff25067704c9538e79f31e71c10045 (patch)
tree237af7a42df5b7309f1824831d465cf8f7e91ca7 /src/libsystemd-network/test-dhcp-server.c
parent2dead8129f7b6fe644e17e1dc1739bebacfe1364 (diff)
sd-dhcp-server: add basic NAK support
Diffstat (limited to 'src/libsystemd-network/test-dhcp-server.c')
-rw-r--r--src/libsystemd-network/test-dhcp-server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-network/test-dhcp-server.c b/src/libsystemd-network/test-dhcp-server.c
index 10fc2368cf..f738b3b427 100644
--- a/src/libsystemd-network/test-dhcp-server.c
+++ b/src/libsystemd-network/test-dhcp-server.c
@@ -150,7 +150,7 @@ static void test_message_handler(void) {
test.option_requested_ip.code = DHCP_OPTION_REQUESTED_IP_ADDRESS;
test.option_requested_ip.length = 4;
test.option_requested_ip.address = htobe32(0x12345678);
- assert_se(dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test)) == 0);
+ assert_se(dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test)) == DHCP_NAK);
test.option_server_id.code = DHCP_OPTION_SERVER_IDENTIFIER;
test.option_server_id.length = 4;
test.option_server_id.address = htobe32(INADDR_LOOPBACK);
@@ -159,8 +159,8 @@ static void test_message_handler(void) {
test.option_server_id.address = htobe32(0x12345678);
test.option_requested_ip.address = htobe32(INADDR_LOOPBACK + 3);
assert_se(dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test)) == 0);
- test.option_server_id.address = htobe32(INADDR_LOOPBACK + 3);
- test.option_requested_ip.address = htobe32(0x12345678);
+ test.option_server_id.address = htobe32(INADDR_LOOPBACK);
+ test.option_requested_ip.address = htobe32(INADDR_LOOPBACK + 30);
assert_se(dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test)) == 0);
}