From a4b16942119a09a7292b2f910569f48efc7d7049 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 26 Apr 2018 11:18:56 +0200 Subject: 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 Signed-off-by: Sander Vrijders --- src/lib/dev.c | 1 + 1 file changed, 1 insertion(+) 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); -- cgit v1.2.3