mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-13 05:00:17 +01:00
n-dhcp4: handle invalid return codes gracefully
Instead of terminating the program when the dispatch function returns
an invalid return code, log an error message and convert the error
code to a valid, generic one.
https://bugs.archlinux.org/task/64880
(cherry picked from commit 36f8822c9b)
This commit is contained in:
parent
6017d78734
commit
5586a07f2f
1 changed files with 6 additions and 1 deletions
|
|
@ -681,7 +681,12 @@ _c_public_ int n_dhcp4_client_dispatch(NDhcp4Client *client) {
|
|||
|
||||
/* continue normally */
|
||||
} else if (r) {
|
||||
c_assert(r < _N_DHCP4_E_INTERNAL);
|
||||
if (r >= _N_DHCP4_E_INTERNAL) {
|
||||
n_dhcp4_c_log(client->config, LOG_ERR,
|
||||
"invalid internal error code %d after dispatch",
|
||||
r);
|
||||
return N_DHCP4_E_INTERNAL;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue