From 5d8519018bda6af03c116604a2922625b00f8e52 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 10 Feb 2018 10:12:02 +0100 Subject: ipcpd: Revise lookup tracking in DHT The lookups now track the responses by cookie instead of just counting the remaining number of responses. This is needed because simultaneous lookups for the same hash interfere with eachother and lead to missed responses. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/fa.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/normal/fa.c') diff --git a/src/ipcpd/normal/fa.c b/src/ipcpd/normal/fa.c index 8d8b51ee..2b3f5c2a 100644 --- a/src/ipcpd/normal/fa.c +++ b/src/ipcpd/normal/fa.c @@ -229,10 +229,12 @@ int fa_alloc(int fd, uint64_t addr; struct shm_du_buff * sdb; - if (ipcp_sdb_reserve(&sdb, sizeof(*msg) + ipcp_dir_hash_len())) + addr = dir_query(dst); + if (addr == 0) return -1; - addr = dir_query(dst); + if (ipcp_sdb_reserve(&sdb, sizeof(*msg) + ipcp_dir_hash_len())) + return -1; msg = (struct fa_msg *) shm_du_buff_head(sdb); msg->code = FLOW_REQ; -- cgit v1.2.3