mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 15:40:22 +01:00
n-dhcp4: fix n_dhcp4_client_lease_get_server_identifier()
N_DHCP4_E_MALFORMED is an internal error code, replace it with
N_DHCP4_E_INTERNAL. Also, remove extra spaces.
(cherry picked from commit be6997d127)
This commit is contained in:
parent
667f2a5d76
commit
a4acfef3aa
2 changed files with 6 additions and 4 deletions
|
|
@ -249,9 +249,11 @@ _c_public_ void n_dhcp4_client_lease_get_lifetime(NDhcp4ClientLease *lease, uint
|
|||
* Gets the address contained in the server-identifier DHCP option, in network
|
||||
* byte order.
|
||||
*
|
||||
* Return: 0 on success, negative error code on failure.
|
||||
* Return: 0 on success,
|
||||
* N_DHCP4_E_UNSET if the lease doesn't contain a server-identifier, or
|
||||
* N_DCHP4_E_INTERNAL if the server-identifier is not valid.
|
||||
*/
|
||||
_c_public_ int n_dhcp4_client_lease_get_server_identifier (NDhcp4ClientLease *lease, struct in_addr *addr) {
|
||||
_c_public_ int n_dhcp4_client_lease_get_server_identifier(NDhcp4ClientLease *lease, struct in_addr *addr) {
|
||||
uint8_t *data;
|
||||
size_t n_data;
|
||||
int r;
|
||||
|
|
@ -260,7 +262,7 @@ _c_public_ int n_dhcp4_client_lease_get_server_identifier (NDhcp4ClientLease *le
|
|||
if (r)
|
||||
return r;
|
||||
if (n_data < sizeof(struct in_addr))
|
||||
return N_DHCP4_E_MALFORMED;
|
||||
return N_DHCP4_E_INTERNAL;
|
||||
|
||||
memcpy(addr, data, sizeof(struct in_addr));
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void n_dhcp4_client_lease_get_siaddr(NDhcp4ClientLease *lease, struct in_addr *s
|
|||
void n_dhcp4_client_lease_get_basetime(NDhcp4ClientLease *lease, uint64_t *ns_basetimep);
|
||||
void n_dhcp4_client_lease_get_lifetime(NDhcp4ClientLease *lease, uint64_t *ns_lifetimep);
|
||||
int n_dhcp4_client_lease_query(NDhcp4ClientLease *lease, uint8_t option, uint8_t **datap, size_t *n_datap);
|
||||
int n_dhcp4_client_lease_get_server_identifier (NDhcp4ClientLease *lease, struct in_addr *addr);
|
||||
int n_dhcp4_client_lease_get_server_identifier(NDhcp4ClientLease *lease, struct in_addr *addr);
|
||||
|
||||
int n_dhcp4_client_lease_select(NDhcp4ClientLease *lease);
|
||||
int n_dhcp4_client_lease_accept(NDhcp4ClientLease *lease);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue