summaryrefslogtreecommitdiff
path: root/src/lib/dev.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-04-26 11:18:56 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-04-26 11:56:59 +0200
commita4b16942119a09a7292b2f910569f48efc7d7049 (patch)
tree9a1bb8dc5f7a3957c8f2904cfa4ae0c782aba1f9 /src/lib/dev.c
parent639a17a3ac9236494b814e51a34583b4dccd754c (diff)
downloadouroboros-a4b16942119a09a7292b2f910569f48efc7d7049.tar.gz
ouroboros-a4b16942119a09a7292b2f910569f48efc7d7049.zip
lib: Shut rx buffer down before cleanup and exit
If a program exits, it cleans its read buffer. However, another process could still write a packet in that buffer, which would cause the IPCP or IRMd to run into an assertion failure on shutdown. Setting the rbuff to ACL_FLOWDOWN prevents this. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/lib/dev.c')
-rw-r--r--src/lib/dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index d9589b08..edcf56ed 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -444,6 +444,7 @@ static void fini(void)
for (i = 0; i < PROG_MAX_FLOWS; ++i) {
if (ai.flows[i].port_id != -1) {
ssize_t idx;
+ shm_rbuff_set_acl(ai.flows[i].rx_rb, ACL_FLOWDOWN);
while ((idx = shm_rbuff_read(ai.flows[i].rx_rb)) >= 0)
shm_rdrbuff_remove(ai.rdrb, idx);
flow_fini(i);