diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:27:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:27:56 +0000 |
commit | 26fde72265073b26498ce55596c0eda1bc3113b4 (patch) | |
tree | 580247f9ae59f3bb05e3b9ee52eb4fe51b63887b /src/libsystemd-network/test-dhcp-server.c | |
parent | Adding upstream version 256.5. (diff) | |
download | systemd-1bbf86c6616f4a29fce9f56b662b09d4566765d9.tar.xz systemd-1bbf86c6616f4a29fce9f56b662b09d4566765d9.zip |
Adding upstream version 256.6.upstream/256.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/libsystemd-network/test-dhcp-server.c')
-rw-r--r-- | src/libsystemd-network/test-dhcp-server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsystemd-network/test-dhcp-server.c b/src/libsystemd-network/test-dhcp-server.c index ecd030e..228b166 100644 --- a/src/libsystemd-network/test-dhcp-server.c +++ b/src/libsystemd-network/test-dhcp-server.c @@ -127,6 +127,7 @@ static void test_message_handler(void) { .s_addr = htobe32(INADDR_LOOPBACK + 42), }; static uint8_t static_lease_client_id[7] = {0x01, 'A', 'B', 'C', 'D', 'E', 'G' }; + int r; log_debug("/* %s */", __func__); @@ -137,7 +138,10 @@ static void test_message_handler(void) { assert_se(sd_dhcp_server_attach_event(server, NULL, 0) >= 0); assert_se(sd_dhcp_server_start(server) >= 0); - assert_se(dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test), NULL) == DHCP_OFFER); + r = dhcp_server_handle_message(server, (DHCPMessage*)&test, sizeof(test), NULL); + if (r == -ENETDOWN) + return (void) log_tests_skipped("Network is not available"); + assert_se(r == DHCP_OFFER); test.end = 0; /* TODO, shouldn't this fail? */ |