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/sd-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/sd-dhcp-client.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 854c6711a8..14f226793c 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -143,7 +143,7 @@ int sd_dhcp_client_set_index(sd_dhcp_client *client, int interface_index) { assert_return(client, -EINVAL); assert_return (IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_STOPPED), -EBUSY); - assert_return(interface_index >= -1, -EINVAL); + assert_return(interface_index > 0, -EINVAL); client->index = interface_index; |