From e87f2b683446fe424dc5e8fed60456240e080562 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 3 Mar 2019 19:08:48 +0100 Subject: ipcpd: Refactor create_r and flow_req_arr The API calls for the IPCP to inform the IRMd of IPCP creation and incoming flow request had the pid_t in the call. This pid_t is removed and the getpid() call is now placed inside the function. Also refactors the cleanup for the main() functions of some of the lower IPCPs. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/dev.c b/src/lib/dev.c index 297c85f7..10b34e4e 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1262,8 +1262,7 @@ int np1_flow_resp(int flow_id) return fd; } -int ipcp_create_r(pid_t pid, - int result) +int ipcp_create_r(int result) { irm_msg_t msg = IRM_MSG__INIT; irm_msg_t * recv_msg; @@ -1271,7 +1270,7 @@ int ipcp_create_r(pid_t pid, msg.code = IRM_MSG_CODE__IPCP_CREATE_R; msg.has_pid = true; - msg.pid = pid; + msg.pid = getpid(); msg.has_result = true; msg.result = result; @@ -1290,8 +1289,7 @@ int ipcp_create_r(pid_t pid, return ret; } -int ipcp_flow_req_arr(pid_t pid, - const uint8_t * dst, +int ipcp_flow_req_arr(const uint8_t * dst, size_t len, qosspec_t qs) { @@ -1304,7 +1302,7 @@ int ipcp_flow_req_arr(pid_t pid, msg.code = IRM_MSG_CODE__IPCP_FLOW_REQ_ARR; msg.has_pid = true; - msg.pid = pid; + msg.pid = getpid(); msg.has_hash = true; msg.hash.len = len; msg.hash.data = (uint8_t *) dst; -- cgit v1.2.3