diff options
author | Umut Tezduyar Lindskog <umut.tezduyar@axis.com> | 2014-04-27 21:58:26 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-27 23:39:13 +0200 |
commit | d9bf4f8c6c47b8620ffa1a056208eb15118b78d5 (patch) | |
tree | 3d2504b2ec9cc9b3ff69f56ca4d79cdf94acba8c /src/libsystemd-network/test-dhcp-client.c | |
parent | d96e629fd7a29323ab19917d5afeb05adc62b373 (diff) |
libnetworkd: add link local tests
- Also only allow positive ifindex on both dhcp and ipv4ll
[tomegun: the kernel always sets a positive ifindex, but some APIs accept
ifindex=0 with various meanings, so we should protect against
accidentally passing ifindex=0 along.]
Diffstat (limited to 'src/libsystemd-network/test-dhcp-client.c')
-rw-r--r-- | src/libsystemd-network/test-dhcp-client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index e7787fa0f1..83dd619407 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -79,7 +79,9 @@ static void test_request_basic(sd_event *e) assert_se(sd_dhcp_client_set_index(client, 15) == 0); assert_se(sd_dhcp_client_set_index(client, -42) == -EINVAL); - assert_se(sd_dhcp_client_set_index(client, -1) == 0); + assert_se(sd_dhcp_client_set_index(client, -1) == -EINVAL); + assert_se(sd_dhcp_client_set_index(client, 0) == -EINVAL); + assert_se(sd_dhcp_client_set_index(client, 1) == 0); assert_se(sd_dhcp_client_set_request_option(client, DHCP_OPTION_SUBNET_MASK) == -EEXIST); |