diff options
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r-- | src/ipcpd/unicast/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/ipcpd/unicast/fa.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ipcpd/unicast/CMakeLists.txt b/src/ipcpd/unicast/CMakeLists.txt index f4887160..e1fe1074 100644 --- a/src/ipcpd/unicast/CMakeLists.txt +++ b/src/ipcpd/unicast/CMakeLists.txt @@ -13,6 +13,8 @@ include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}/include) set(IPCP_UNICAST_TARGET ipcpd-unicast CACHE INTERNAL "") +set(IPCP_UNICAST_MPL 60 CACHE STRING + "Default maximum packet lifetime for the unicast IPCP, in seconds") protobuf_generate_c(KAD_PROTO_SRCS KAD_PROTO_HDRS dir/kademlia.proto) diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c index d59b9760..eb467a90 100644 --- a/src/ipcpd/unicast/fa.c +++ b/src/ipcpd/unicast/fa.c @@ -477,6 +477,7 @@ static int fa_wait_irmd_alloc(uint8_t * dst, struct timespec ts = {0, TIMEOUT * 1000}; struct timespec abstime; int fd; + time_t mpl = IPCP_UNICAST_MPL; clock_gettime(PTHREAD_COND_CLOCK, &abstime); @@ -497,7 +498,7 @@ static int fa_wait_irmd_alloc(uint8_t * dst, assert(ipcpi.alloc_id == -1); - fd = ipcp_flow_req_arr(dst, ipcp_dir_hash_len(), qs, data, len); + fd = ipcp_flow_req_arr(dst, ipcp_dir_hash_len(), qs, mpl, data, len); if (fd < 0) { pthread_mutex_unlock(&ipcpi.alloc_lock); log_dbg("Failed to get fd for flow."); @@ -598,6 +599,7 @@ static int fa_handle_flow_reply(struct fa_msg * msg, struct fa_flow * flow; uint8_t * data; /* Piggbacked data on flow alloc request. */ size_t dlen; /* Length of piggybacked data. */ + time_t mpl = IPCP_UNICAST_MPL; assert(len >= sizeof(*msg)); @@ -623,7 +625,7 @@ static int fa_handle_flow_reply(struct fa_msg * msg, pthread_rwlock_unlock(&fa.flows_lock); - if (ipcp_flow_alloc_reply(fd, msg->response, data, dlen)) + if (ipcp_flow_alloc_reply(fd, msg->response, mpl, data, dlen)) return -EIRMD; return 0; |