summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-02-26 14:13:51 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-03-03 12:00:54 +0100
commit942649dfb7530f116ea19f36af20b0495a9251f8 (patch)
treeb5beec23fa123beb2ba2b9c85111295c738a737d /src/lib
parent5db145717d48a6ef82890a7a314af6ef89edbc8d (diff)
downloadouroboros-942649dfb7530f116ea19f36af20b0495a9251f8.tar.gz
ouroboros-942649dfb7530f116ea19f36af20b0495a9251f8.zip
lib: Cleanup RIB mount name
IPCPs would call rib_fini() twice, once after cleaning up their managed RIB, and once again for the program-generic RIB, which is not initialized for IPCPs. rib_fini() checked if the mount name was valid, but it didn't unset it after execution. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/rib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c
index 27c66f2f..2a21c2cc 100644
--- a/src/lib/rib.c
+++ b/src/lib/rib.c
@@ -338,7 +338,7 @@ int rib_init(const char * mountpt)
fuse_opt_free_args(&args);
rmdir(rib.mnt);
fail_mnt:
- memset(rib.mnt, 0, RIB_PATH_LEN + 1);
+ memset(rib.mnt, 0, sizeof(rib.mnt));
fail:
return -1;
#else
@@ -377,6 +377,8 @@ void rib_fini(void)
pthread_rwlock_unlock(&rib.lock);
pthread_rwlock_destroy(&rib.lock);
+
+ memset(rib.mnt, 0, sizeof(rib.mnt));
#endif
}