From c47e8936a43ce546e8a74fa569e9fbfae6c64be7 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Wed, 10 Dec 2014 16:17:30 +0200 Subject: [PATCH] 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. --- src/libsystemd-network/sd-dhcp6-client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 8537d7cc8..cc5b74416 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; -- 2.30.2