diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2014-12-10 16:17:30 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-12-10 18:31:21 +0100 |
commit | c47e8936a43ce546e8a74fa569e9fbfae6c64be7 (patch) | |
tree | 3052369118db0b807a5fe6e5f2fefac943eedcd0 /src/libsystemd-network | |
parent | 8c67d0a74bc466f0a21d96625ce6b4e24b2a5f1f (diff) |
sd-dhcp6-client: Make end of successfull option parsing explicit
When all DHCPv6 options have been parsed, dhcp6_option_parse() returns
-ENOMSG. Explicitely set the return value to indicate success so that
later code does not need to take this special value into account.
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 8537d7cc86..cc5b74416f 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -770,7 +770,10 @@ static int client_parse_message(sd_dhcp6_client *client, } } - if ((r < 0 && r != -ENOMSG) || !clientid) { + if (r == -ENOMSG) + r = 0; + + if (r < 0 || !clientid) { log_dhcp6_client(client, "%s has incomplete options", dhcp6_message_type_to_string(message->type)); return -EINVAL; |