]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: avoid "maybe-uninitialized" warning in client_timeout_resend()
authorThomas Haller <thaller@redhat.com>
Wed, 23 Dec 2020 12:18:56 +0000 (13:18 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 26 Dec 2020 00:01:01 +0000 (09:01 +0900)
When compiling with CFLAGS='-Werror=maybe-uninitialized -Og' we get a
warning about uninitialized "next_timeout" variable.

Avoid the warning by adding an (unreachable) "default" label.

Fixes: c24288d21ee9 ("sd-dhcp-client: correct dhcpv4 renew/rebind retransmit timeouts")
src/libsystemd-network/sd-dhcp-client.c

index 939dbac5bb865f1d59cda513faeb1f9766f70192..7604aafd6f8ae9b5a24cb300e6c9c87fce063eae 100644 (file)
@@ -1275,6 +1275,9 @@ static int client_timeout_resend(
         case DHCP_STATE_STOPPED:
                 r = -EINVAL;
                 goto error;
+
+        default:
+                assert_not_reached("Unhandled choice");
         }
 
         r = event_reset_time(client->event, &client->timeout_resend,