From 2410108f3226f08e0ee0ec1040e0a71e37452b8c Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Fri, 31 Mar 2017 20:35:11 +0200 Subject: ipcpd: Fix CDAP return checks at enrollment --- src/ipcpd/normal/enroll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index e2762993..3e6a0197 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -200,7 +200,7 @@ int enroll_boot(char * dst_name) clock_gettime(CLOCK_REALTIME, &t0); key = cdap_request_send(cdap, CDAP_READ, TIME_PATH, NULL, 0, 0); - if (key == NULL) { + if (key == NULL || key[0] == INVALID_CDAP_KEY) { log_err("Failed to send CDAP request."); cdap_destroy(cdap); flow_dealloc(conn.flow_info.fd); @@ -232,7 +232,7 @@ int enroll_boot(char * dst_name) free(data); key = cdap_request_send(cdap, CDAP_READ, boot_ro, NULL, 0, 0); - if (key == NULL) { + if (key == NULL || key[0] == INVALID_CDAP_KEY) { log_err("Failed to send CDAP request."); cdap_destroy(cdap); flow_dealloc(conn.flow_info.fd); @@ -263,7 +263,7 @@ int enroll_boot(char * dst_name) log_dbg("Packed information inserted into RIB."); key = cdap_request_send(cdap, CDAP_READ, members_ro, NULL, 0, 0); - if (key == NULL) { + if (key == NULL || key[0] == INVALID_CDAP_KEY) { log_err("Failed to send CDAP request."); cdap_destroy(cdap); flow_dealloc(conn.flow_info.fd); @@ -294,7 +294,7 @@ int enroll_boot(char * dst_name) log_dbg("Packed information inserted into RIB."); key = cdap_request_send(cdap, CDAP_READ, dif_ro, NULL, 0, 0); - if (key == NULL) { + if (key == NULL || key[0] == INVALID_CDAP_KEY) { log_err("Failed to send CDAP request."); cdap_destroy(cdap); flow_dealloc(conn.flow_info.fd); -- cgit v1.2.3