diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-11-17 15:57:50 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-11-17 15:58:43 +0100 |
commit | a339859f798007b57a63729aee75f0415f52f763 (patch) | |
tree | 0138b64b7b03b7c2f2b5bb15207797e628b9293b /src/libsystemd-network | |
parent | dhcp4: propagate error in restarting DHCPv4 client (diff) | |
download | systemd-a339859f798007b57a63729aee75f0415f52f763.tar.xz systemd-a339859f798007b57a63729aee75f0415f52f763.zip |
dhcp6: add debug logs
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 95b7237382..5417ba8c5f 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -232,7 +232,7 @@ static int dhcp6_client_set_duid_internal( if (r < 0) { r = dhcp_validate_duid_len(duid_type, duid_len, false); if (r < 0) - return r; + return log_dhcp6_client_errno(client, r, "Failed to validate length of DUID: %m"); log_dhcp6_client(client, "Setting DUID of type %u with unexpected content", duid_type); } @@ -243,32 +243,32 @@ static int dhcp6_client_set_duid_internal( switch (duid_type) { case DUID_TYPE_LLT: if (client->mac_addr_len == 0) - return -EOPNOTSUPP; + return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LLT, MAC address is not set."); r = dhcp_identifier_set_duid_llt(&client->duid, llt_time, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len); if (r < 0) - return r; + return log_dhcp6_client_errno(client, r, "Failed to set DUID-LLT: %m"); break; case DUID_TYPE_EN: r = dhcp_identifier_set_duid_en(&client->duid, &client->duid_len); if (r < 0) - return r; + return log_dhcp6_client_errno(client, r, "Failed to set DUID-EN: %m"); break; case DUID_TYPE_LL: if (client->mac_addr_len == 0) - return -EOPNOTSUPP; + return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EOPNOTSUPP), "Failed to set DUID-LL, MAC address is not set."); r = dhcp_identifier_set_duid_ll(&client->duid, client->mac_addr, client->mac_addr_len, client->arp_type, &client->duid_len); if (r < 0) - return r; + return log_dhcp6_client_errno(client, r, "Failed to set DUID-LL: %m"); break; case DUID_TYPE_UUID: r = dhcp_identifier_set_duid_uuid(&client->duid, &client->duid_len); if (r < 0) - return r; + return log_dhcp6_client_errno(client, r, "Failed to set DUID-UUID: %m"); break; default: - return -EINVAL; + return log_dhcp6_client_errno(client, SYNTHETIC_ERRNO(EINVAL), "Invalid DUID type"); } return 0; |