From c41bdb17fc12275b9f0008da82f7d0b4eb62c2c0 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 6 Feb 2022 23:58:36 +0900 Subject: [PATCH] sd-dhcp6-client: call client_notify() in client_enter_bound_state() --- src/libsystemd-network/sd-dhcp6-client.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 1408878da3..ff2025efe7 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -895,6 +895,7 @@ static int client_enter_bound_state(sd_dhcp6_client *client) { } client->state = DHCP6_STATE_BOUND; + client_notify(client, SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE); return 0; error: @@ -1139,12 +1140,7 @@ static int client_process_reply( sd_dhcp6_lease_unref(client->lease); client->lease = TAKE_PTR(lease); - r = client_enter_bound_state(client); - if (r < 0) - return r; - - client_notify(client, SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE); - return 0; + return client_enter_bound_state(client); } static int client_process_advertise_or_rapid_commit_reply( @@ -1183,12 +1179,7 @@ static int client_process_advertise_or_rapid_commit_reply( sd_dhcp6_lease_unref(client->lease); client->lease = TAKE_PTR(lease); - r = client_enter_bound_state(client); - if (r < 0) - return r; - - client_notify(client, SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE); - return 0; + return client_enter_bound_state(client); } r = dhcp6_lease_get_preference(lease, &pref_advertise);