1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

sd-dhcp6-client: do not ignore errors in client_receive_advertise()

This also adds several debug log messages.
This commit is contained in:
Yu Watanabe 2021-08-04 22:59:39 +09:00 committed by Luca Boccassi
parent fa55e7b338
commit d7799877a0

View File

@ -1479,15 +1479,16 @@ static int client_receive_message(
return 0; return 0;
} }
if (client->transaction_id != (message->transaction_id & if (client->transaction_id != (message->transaction_id & htobe32(0x00ffffff)))
htobe32(0x00ffffff)))
return 0; return 0;
switch (client->state) { switch (client->state) {
case DHCP6_STATE_INFORMATION_REQUEST: case DHCP6_STATE_INFORMATION_REQUEST:
r = client_receive_reply(client, message, len); r = client_receive_reply(client, message, len);
if (r < 0) if (r < 0) {
log_dhcp6_client_errno(client, r, "Failed to process received reply message, ignoring: %m");
return 0; return 0;
}
client_notify(client, SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST); client_notify(client, SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST);
@ -1497,10 +1498,13 @@ static int client_receive_message(
case DHCP6_STATE_SOLICITATION: case DHCP6_STATE_SOLICITATION:
r = client_receive_advertise(client, message, len); r = client_receive_advertise(client, message, len);
if (r < 0) {
log_dhcp6_client_errno(client, r, "Failed to process received advertise message, ignoring: %m");
return 0;
}
if (r == DHCP6_STATE_REQUEST) { if (r == DHCP6_STATE_REQUEST) {
client_start(client, r); client_start(client, r);
break; break;
} }
@ -1510,11 +1514,12 @@ static int client_receive_message(
case DHCP6_STATE_REBIND: case DHCP6_STATE_REBIND:
r = client_receive_reply(client, message, len); r = client_receive_reply(client, message, len);
if (r < 0) if (r < 0) {
log_dhcp6_client_errno(client, r, "Failed to process received reply message, ignoring: %m");
return 0; return 0;
}
if (r == DHCP6_STATE_BOUND) { if (r == DHCP6_STATE_BOUND) {
r = client_start(client, DHCP6_STATE_BOUND); r = client_start(client, DHCP6_STATE_BOUND);
if (r < 0) { if (r < 0) {
client_stop(client, r); client_stop(client, r);