diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-07-18 11:07:43 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-07-18 11:07:43 +0000 |
commit | aff9a39ade6ec39be0b0de7c360a66ed4c6a1e1b (patch) | |
tree | adf6a907d87f11668ccdf0f2df83efd93068f292 /src/ipcpd/normal/dt.c | |
parent | a295fd7b24c86f071061aa15e7c82c2463b001b5 (diff) | |
parent | 6e739b09bef860a4830328630ea07622bdd79d79 (diff) | |
download | ouroboros-aff9a39ade6ec39be0b0de7c360a66ed4c6a1e1b.tar.gz ouroboros-aff9a39ade6ec39be0b0de7c360a66ed4c6a1e1b.zip |
Merged in dstaesse/ouroboros/be-dht (pull request #529)
ipcpd: Add DHT as directory in normal IPCP
Diffstat (limited to 'src/ipcpd/normal/dt.c')
-rw-r--r-- | src/ipcpd/normal/dt.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c index 1867c13b..5fcc5865 100644 --- a/src/ipcpd/normal/dt.c +++ b/src/ipcpd/normal/dt.c @@ -50,7 +50,7 @@ #include <assert.h> struct ae_info { - int (*post_sdu)(void * ae, struct shm_du_buff * sdb); + void (* post_sdu)(void * ae, struct shm_du_buff * sdb); void * ae; }; @@ -131,11 +131,14 @@ static int sdu_handler(int fd, return 0; } - if (dt.aes[dt_pci.fd].post_sdu(dt.aes[dt_pci.fd].ae, sdb)) { + if (dt.aes[dt_pci.fd].post_sdu == NULL) { + log_err("No registered AE on fd %d.", dt_pci.fd); ipcp_sdb_release(sdb); - return -1; + return -EPERM; } + dt.aes[dt_pci.fd].post_sdu(dt.aes[dt_pci.fd].ae, sdb); + return 0; } @@ -295,7 +298,7 @@ void dt_stop(void) } int dt_reg_ae(void * ae, - int (* func)(void * func, struct shm_du_buff *)) + void (* func)(void * func, struct shm_du_buff *)) { int res_fd; @@ -330,10 +333,11 @@ int dt_write_sdu(uint64_t dst_addr, struct dt_pci dt_pci; assert(sdb); + assert(dst_addr != ipcpi.dt_addr); fd = pff_nhop(dt.pff[qc], dst_addr); if (fd < 0) { - log_err("Could not get nhop for addr %" PRIu64 ".", dst_addr); + log_dbg("Could not get nhop for addr %" PRIu64 ".", dst_addr); return -1; } |