summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-03-03 19:08:48 +0100
committerSander Vrijders <sander@ouroboros.rocks>2019-03-04 08:57:57 +0100
commite87f2b683446fe424dc5e8fed60456240e080562 (patch)
treef61d89c35ded13d743e207b31ce68546ca53d9e1 /src/ipcpd/normal
parente00c9b13acad23e14df9d5cf4c7868dfd6e1bc55 (diff)
downloadouroboros-e87f2b683446fe424dc5e8fed60456240e080562.tar.gz
ouroboros-e87f2b683446fe424dc5e8fed60456240e080562.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r--src/ipcpd/normal/fa.c3
-rw-r--r--src/ipcpd/normal/main.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/ipcpd/normal/fa.c b/src/ipcpd/normal/fa.c
index 30d87df5..e03467c2 100644
--- a/src/ipcpd/normal/fa.c
+++ b/src/ipcpd/normal/fa.c
@@ -218,8 +218,7 @@ static void * fa_handle_packet(void * o)
qs.in_order = msg->in_order;
qs.max_gap = ntoh32(msg->max_gap);
- fd = ipcp_flow_req_arr(getpid(),
- (uint8_t *) (msg + 1),
+ fd = ipcp_flow_req_arr((uint8_t *) (msg + 1),
ipcp_dir_hash_len(),
qs);
if (fd < 0) {
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 7a453a9e..28fc8c5a 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -334,7 +334,7 @@ int main(int argc,
goto fail_boot;
}
- if (ipcp_create_r(getpid(), 0)) {
+ if (ipcp_create_r(0)) {
log_err("Failed to notify IRMd we are initialized.");
ipcp_set_state(IPCP_NULL);
goto fail_create_r;
@@ -373,6 +373,6 @@ int main(int argc,
fail_rib_init:
ipcp_fini();
fail_init:
- ipcp_create_r(getpid(), -1);
+ ipcp_create_r(-1);
exit(EXIT_FAILURE);
}