Skip to content

Commit 4331c7d

Browse files
committed
qdevice: Destroy non blocking client on failure
This fixes regression introduced in patch 8217e33 which made qdevice assert when PR_GetError in nss_sock_non_blocking_client_try_next called by qdevice_model_net_pre_poll_loop returns error other than PR_IN_PROGRESS_ERROR. This is usually not happening - only way to get such error seems to be to ifdown ALL network interfaces other than loopback and returned error is then PR_NETWORK_UNREACHABLE_ERROR (-5980). Fix is rather simple (and present in pre 8217e33) - just call nss_sock_non_blocking_client_destroy. Signed-off-by: Jan Friesse <[email protected]>
1 parent b43eb6e commit 4331c7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

qdevices/qdevice-model-net.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ qdevice_model_net_pre_poll_loop(struct qdevice_instance *instance)
211211
res = nss_sock_non_blocking_client_try_next(&net_instance->non_blocking_client);
212212
if (res == -1) {
213213
log_nss(LOG_ERR, "Can't connect to qnetd host");
214+
/*
215+
* To prevent adding non_blocking_client into loop but still keep loop running
216+
*/
217+
nss_sock_non_blocking_client_destroy(&net_instance->non_blocking_client);
214218
}
215219

216220
res = qdevice_net_socket_add_to_main_poll_loop(net_instance);

0 commit comments

Comments
 (0)