networkd: dhcp6 - don't log about losing a lease we never had

This commit is contained in:
Tom Gundersen
2015-11-13 14:51:06 +01:00
parent cf0f970fe1
commit 3098562c92
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -259,12 +259,12 @@ int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, uint16_t option)
int sd_dhcp6_client_get_lease(sd_dhcp6_client *client, sd_dhcp6_lease **ret) {
assert_return(client, -EINVAL);
assert_return(ret, -EINVAL);
if (!client->lease)
return -ENOMSG;
*ret = client->lease;
if (ret)
*ret = client->lease;
return 0;
}
+2 -1
View File
@@ -131,7 +131,8 @@ static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) {
case SD_DHCP6_CLIENT_EVENT_STOP:
case SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE:
case SD_DHCP6_CLIENT_EVENT_RETRANS_MAX:
log_link_warning(link, "DHCPv6 lease lost");
if (sd_dhcp6_client_get_lease(client, NULL) >= 0)
log_link_warning(link, "DHCPv6 lease lost");
link->dhcp6_configured = false;
break;