From 08332eefba9aa4b08d00e190720de4771081e855 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 28 Aug 2023 12:29:00 +0200 Subject: 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 Signed-off-by: Sander Vrijders --- src/ipcpd/ipcp.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ipcpd/ipcp.h') 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); -- cgit v1.2.3