dhcp-client4: do not send release message when there is no lease
The daemon crashes when NM tries to send the release message when there is no lease yet and the UDP socket is still in the PACKET state, which causes an assertion failure as the result. Add the condition to guarantee that n-dhcp4 only sends the release message when there is a lease. Resolves: https://issues.redhat.com/browse/RHEL-69132 Stack trace of the crash: 0 0x00007f5ac248bacc __pthread_kill_implementation (libc.so.6 + 0x8bacc) 1 0x00007f5ac243e686 __GI_raise (libc.so.6 + 0x3e686) 2 0x00007f5ac2428833 __GI_abort (libc.so.6 + 0x28833) 3 0x00007f5ac242875b __assert_fail_base (libc.so.6 + 0x2875b) 4 0x00007f5ac24373c6 __assert_fail (libc.so.6 + 0x373c6) 5 0x00005607ec7f194a n_dhcp4_c_connection_udp_send (NetworkManager + 0x8594a) 6 0x00005607eca228cc n_dhcp4_c_connection_start_request (NetworkManager + 0x2b68cc) 7 0x00005607eca14b31 nm_dhcp_client_stop (NetworkManager + 0x2a8b31) 8 0x00005607eca8a4ce _dev_ipdhcpx_cleanup (NetworkManager + 0x31e4ce) 9 0x00005607ecac144d _cleanup_ip_pre (NetworkManager + 0x35544d) 10 0x00005607ecac3f04 _cleanup_generic_pre (NetworkManager + 0x357f04) 11 0x00005607ecad5006 nm_device_cleanup (NetworkManager + 0x369006) 12 0x00005607ecac5230 _set_state_full (NetworkManager + 0x359230) 13 0x00005607ecac8c4a nm_device_state_changed (NetworkManager + 0x35cc4a) 14 0x00007f5ac2daa47b g_idle_dispatch (libglib-2.0.so.0 + 0x5147b) 15 0x00007f5ac2dadf4f g_main_dispatch (libglib-2.0.so.0 + 0x54f4f) 16 0x00007f5ac2e03268 g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa268) 17 0x00007f5ac2dad5a3 g_main_loop_run (libglib-2.0.so.0 + 0x545a3) 18 0x00005607ec7c3eed main (NetworkManager + 0x57eed) 19 0x00007f5ac24295d0 __libc_start_call_main (libc.so.6 + 0x295d0) 20 0x00007f5ac2429680 __libc_start_main_impl (libc.so.6 + 0x29680) 21 0x00005607ec7c43f5 _start (NetworkManager + 0x583f5)
This commit is contained in:
@@ -1542,7 +1542,10 @@ stop(NMDhcpClient *client, gboolean release)
|
|||||||
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
NMDhcpNettoolsPrivate *priv = NM_DHCP_NETTOOLS_GET_PRIVATE(self);
|
||||||
|
|
||||||
if (release) {
|
if (release) {
|
||||||
if (n_dhcp4_client_probe_release(priv->probe))
|
/* After we receive a lease from server, it doesn't matter if we completed ACD,
|
||||||
|
* we should send the release message. */
|
||||||
|
if (nm_dhcp_client_get_lease(client, FALSE)
|
||||||
|
&& n_dhcp4_client_probe_release(priv->probe) < 0)
|
||||||
_LOGT("dhcp-client4: failed to send request with RELEASE message");
|
_LOGT("dhcp-client4: failed to send request with RELEASE message");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user