diff --git a/discovery.c b/discovery.c index b67c91a..b1ae4d6 100644 --- a/discovery.c +++ b/discovery.c @@ -95,6 +95,9 @@ discovery_handle_discover(int fd, controller *cntrlr) binn *map = binn_map(); binn_map_set_blob(map, DISCOVERY_MAPPING_ID, &cntrlr->id, sizeof(uuid_t)); + binn_map_set_str(map, DISCOVERY_MAPPING_NAME, cntrlr->name); + binn_map_set_uint32(map, DISCOVERY_MAPPING_COMMAND_PORT, cntrlr->command_port); + binn_map_set_uint8(map, DISCOVERY_MAPPING_RELAY_COUNT, cntrlr->relay_count); void *payload = binn_ptr(map); size_t payload_size = binn_size(map); diff --git a/models/controller_save.c b/models/controller_save.c index cceeb9e..b99c8a9 100644 --- a/models/controller_save.c +++ b/models/controller_save.c @@ -55,7 +55,7 @@ controller_save(controller *cntrlr, MDB_env *mdb_env) return 1; } - value.mv_size = sizeof(char) * strlen(cntrlr->name); + value.mv_size = sizeof(char) * (strlen(cntrlr->name) + 1); value.mv_data = cntrlr->name; if(controller_save_single(mdb_txn, mdb_dbi, KEY_META_NAME, value)) {