summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/frct.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-04-28 17:56:02 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-04-28 17:56:44 +0200
commit41b73370dba4105ae183babe8f89480e8c9d038a (patch)
tree50e15983363c163164362851d91c3b6f9511e408 /src/ipcpd/normal/frct.c
parent72e8f778024ece5c8025be4767ce89eae349f4b5 (diff)
downloadouroboros-41b73370dba4105ae183babe8f89480e8c9d038a.tar.gz
ouroboros-41b73370dba4105ae183babe8f89480e8c9d038a.zip
ipcpd: Fix some bugs for the normal split
Diffstat (limited to 'src/ipcpd/normal/frct.c')
-rw-r--r--src/ipcpd/normal/frct.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ipcpd/normal/frct.c b/src/ipcpd/normal/frct.c
index 1adcb299..010b9761 100644
--- a/src/ipcpd/normal/frct.c
+++ b/src/ipcpd/normal/frct.c
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <pthread.h>
+#include <string.h>
#include <assert.h>
enum conn_state {
@@ -128,9 +129,11 @@ int frct_init()
int frct_fini()
{
+ size_t len = IRMD_MAX_FLOWS;
+
pthread_mutex_destroy(&frct.instances_lock);
- free(frct.instances);
+ freepp(struct frct_i, frct.instances, len);
bmp_destroy(frct.cep_ids);
@@ -139,8 +142,8 @@ int frct_fini()
return 0;
}
-cep_id_t frct_i_create(uint64_t address,
- qoscube_t cube)
+cep_id_t frct_i_create(uint64_t address,
+ qoscube_t qc)
{
struct frct_i * instance;
cep_id_t id;
@@ -161,7 +164,7 @@ cep_id_t frct_i_create(uint64_t address,
instance->cep_id = id;
instance->state = CONN_PENDING;
instance->seqno = 0;
- instance->cube = cube;
+ instance->cube = qc;
frct.instances[id] = instance;
@@ -170,7 +173,7 @@ cep_id_t frct_i_create(uint64_t address,
return id;
}
-int frct_i_destroy(cep_id_t cep_id)
+int frct_i_destroy(cep_id_t cep_id)
{
struct frct_i * instance;
@@ -262,6 +265,8 @@ int frct_post_sdu(struct shm_du_buff * sdb)
assert(sdb);
+ memset(&frct_pci, 0, sizeof(frct_pci));
+
frct_pci_des(sdb, &frct_pci);
/* Known cep-ids are delivered to FA (minimal DTP) */