mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-10 05:38:26 +02:00
dhcp/nettools: fix error code for FQDN name-too-long check
Use NM_UTILS_ERROR_UNKNOWN explicitly instead of the unrelated variable
'r', which happens to be 0 at this point from a prior unrelated call.
Fixes: aa8d5a3e9e ('dhcp: support FQDN flags in the nettools backend')
This commit is contained in:
parent
061d32a02e
commit
f27b67cd65
1 changed files with 3 additions and 1 deletions
|
|
@ -1470,7 +1470,9 @@ ip4_start(NMDhcpClient *client, GError **error)
|
|||
} else {
|
||||
fqdn_len = strlen(client_config->hostname);
|
||||
if (fqdn_len > sizeof(buffer) - 3) {
|
||||
nm_utils_error_set(error, r, "failed to set DHCP FQDN: name too long");
|
||||
nm_utils_error_set_literal(error,
|
||||
NM_UTILS_ERROR_UNKNOWN,
|
||||
"failed to set DHCP FQDN: name too long");
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(buffer + 3, client_config->hostname, fqdn_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue