1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

Merge pull request #1882 from teg/networkd-dhcp6-fix

networkd: link - fix ipv6ll_gained() handling
This commit is contained in:
Lennart Poettering 2015-11-13 15:29:45 +01:00
commit a7e565d76a
3 changed files with 6 additions and 8 deletions

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;
}

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;

View File

@ -506,9 +506,6 @@ static int link_stop_clients(Link *link) {
assert(link->manager);
assert(link->manager->event);
if (!link->network)
return 0;
if (link->dhcp_client) {
k = sd_dhcp_client_stop(link->dhcp_client);
if (k < 0)
@ -2485,7 +2482,7 @@ int link_ipv6ll_gained(Link *link) {
link->ipv6ll_address = true;
link_check_ready(link);
if (link->network) {
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
r = link_acquire_ipv6_conf(link);
if (r < 0) {
link_enter_failed(link);
@ -2501,7 +2498,7 @@ static int link_carrier_gained(Link *link) {
assert(link);
if (link->network) {
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
r = link_acquire_conf(link);
if (r < 0) {
link_enter_failed(link);