From 34f894b6ccc0e5894088ffe18b48fe705e4dff50 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Mon, 8 Jul 2013 17:52:30 +0200 Subject: [PATCH] Scanner IMV without workitems provides immediate recommendation, too --- .../plugins/imv_scanner/imv_scanner_agent.c | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/libimcv/plugins/imv_scanner/imv_scanner_agent.c b/src/libimcv/plugins/imv_scanner/imv_scanner_agent.c index a8a12bccb..7c1e76dbe 100644 --- a/src/libimcv/plugins/imv_scanner/imv_scanner_agent.c +++ b/src/libimcv/plugins/imv_scanner/imv_scanner_agent.c @@ -442,20 +442,21 @@ METHOD(imv_agent_if_t, batch_ending, TNC_Result, workitem->destroy(workitem); } enumerator->destroy(enumerator); + } - /* finalized all workitems ? */ - if (session->get_workitem_count(session, imv_id) == 0) + /* finalized all workitems ? */ + if (handshake_state == IMV_SCANNER_STATE_WORKITEMS && + session->get_workitem_count(session, imv_id) == 0) + { + result = out_msg->send_assessment(out_msg); + out_msg->destroy(out_msg); + scanner_state->set_handshake_state(scanner_state, IMV_SCANNER_STATE_END); + + if (result != TNC_RESULT_SUCCESS) { - scanner_state->set_handshake_state(scanner_state, - IMV_SCANNER_STATE_END); - result = out_msg->send_assessment(out_msg); - out_msg->destroy(out_msg); - if (result != TNC_RESULT_SUCCESS) - { - return result; - } - return this->agent->provide_recommendation(this->agent, state); + return result; } + return this->agent->provide_recommendation(this->agent, state); } /* send non-empty PA-TNC message with excl flag not set */