From: Patrik Flykt Date: Wed, 10 Dec 2014 14:17:30 +0000 (+0200) Subject: sd-dhcp6-client: Make end of successfull option parsing explicit X-Git-Tag: v218~22 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=c47e8936a43ce546e8a74fa569e9fbfae6c64be7;hp=8c67d0a74bc466f0a21d96625ce6b4e24b2a5f1f 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. --- 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;