summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.h
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2023-08-28 12:29:00 +0200
committerSander Vrijders <sander@ouroboros.rocks>2023-08-30 10:33:20 +0200
commit08332eefba9aa4b08d00e190720de4771081e855 (patch)
tree9e6b4dbf920b3813c696f79c6f2b926f976402b8 /src/ipcpd/ipcp.h
parent870e3fdfaee4991592cc29e90767abd0e9fba43b (diff)
downloadouroboros-08332eefba9aa4b08d00e190720de4771081e855.tar.gz
ouroboros-08332eefba9aa4b08d00e190720de4771081e855.zip
ipcpd: Move alloc race mitigation to common source
All flow allocator code was duplicating the mitigation for a race where the IRMd response for the flow allocation with a new flow fd was arriving before the response to the flow_req_arr. This is now moved to the ipcp common source. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/ipcp.h')
-rw-r--r--src/ipcpd/ipcp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h
index 2d0e39de..9b08d66e 100644
--- a/src/ipcpd/ipcp.h
+++ b/src/ipcpd/ipcp.h
@@ -136,6 +136,15 @@ enum ipcp_state ipcp_get_state(void);
int ipcp_parse_arg(int argc,
char * argv[]);
+/* Helper functions to handle races during flow allocation */
+int ipcp_wait_flow_req_arr(const uint8_t * dst,
+ qosspec_t qs,
+ time_t mpl,
+ const void * data,
+ size_t len);
+
+int ipcp_wait_flow_resp(const int fd);
+
/* Helper functions for directory entries, could be moved */
uint8_t * ipcp_hash_dup(const uint8_t * hash);