From 6bf5f6c011cca5ec25c23b0f2b4adfc605eaa65d Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Fri, 28 Aug 2020 08:53:24 +0200 Subject: [PATCH] qdevice: Fix connect heuristics result callback Previous patch 8dbf1bc8b0f348e468e7c70448705ac92dab68ea was wrong because it fixed the crash but made qdevice not work at all. Correct solution is to test, if state is QDEVICE_NET_INSTANCE_STATE_WAITING_INIT_REPLY. Signed-off-by: Jan Friesse --- qdevices/qdevice-net-heuristics.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qdevices/qdevice-net-heuristics.c b/qdevices/qdevice-net-heuristics.c index 5757fab..050821e 100644 --- a/qdevices/qdevice-net-heuristics.c +++ b/qdevices/qdevice-net-heuristics.c @@ -207,10 +207,12 @@ qdevice_net_connect_heuristics_exec_result_callback(uint32_t seq_number, return (0); } - if (net_instance->state != QDEVICE_NET_INSTANCE_STATE_WAITING_VOTEQUORUM_CMAP_EVENTS) { + if (net_instance->state != QDEVICE_NET_INSTANCE_STATE_WAITING_INIT_REPLY) { /* * Not connected to qnetd -> heuristics will be called again on new connect */ + log(LOG_DEBUG, "Received unexpected net connect heuristics in state %u", + net_instance->state); return (0); }