From 9de8dc4948cf7ce239232aae0889c39ffa39ede2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 28 Aug 2017 18:54:22 +0200 Subject: tools: Add tool to connect IPCP components This enables user-written tools to instruct IPCPs to establish and tear down connections (a.k.a. adjacencies) between its internal components (Management and Data Transfer). For more info, do "irm ipcp connect" or "irm ipcp disconnect" on the command line. This commit exposes a deletion bug in the RIB where FSO's fail to unpack/parse. This will be fixed when the RIB is deprecated. --- src/ipcpd/normal/enroll.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/ipcpd/normal/enroll.c') diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index 2f7dd9bc..7f93ed3a 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -259,14 +259,17 @@ static void * enroll_handle(void * o) continue; } - if (msg->code != ENROLL_CODE__ENROLL_DONE) { + if (msg->code != ENROLL_CODE__ENROLL_DONE || !msg->has_result) { log_err("Wrong message type."); enroll_msg__free_unpacked(msg, NULL); connmgr_dealloc(AEID_ENROLL, &conn); continue; } - log_dbg("Neighbor enrollment successful."); + if (msg->result == 0) + log_dbg("Neighbor enrollment successful."); + else + log_dbg("Neigbor reported failed enrollment."); connmgr_dealloc(AEID_ENROLL, &conn); } @@ -287,13 +290,16 @@ int enroll_boot(struct conn * conn, return 0; } -int enroll_done(struct conn * conn) +int enroll_done(struct conn * conn, + int result) { enroll_msg_t msg = ENROLL_MSG__INIT; uint8_t buf[ENROLL_BUF_LEN]; ssize_t len; - msg.code = ENROLL_CODE__ENROLL_DONE; + msg.code = ENROLL_CODE__ENROLL_DONE; + msg.has_result = true; + msg.result = result; len = enroll_msg__get_packed_size(&msg); if (len < 0) { -- cgit v1.2.3