From 645cf66af11ac36b81648f2e1eb3b1f5aeb7b544 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 16 Feb 2017 19:22:50 +0100 Subject: ipcpd: Move RIB configuration to common header Moves the definitions of paths in the RIB for the normal IPCP to a header ribconfig.h to avoid repetition. --- src/ipcpd/normal/fmgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ipcpd/normal/fmgr.c') diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 31c83ac5..c2b53abf 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -36,6 +36,7 @@ #include "ipcp.h" #include "shm_pci.h" #include "gam.h" +#include "ribconfig.h" #include #include @@ -285,13 +286,13 @@ int fmgr_init(void) } } - if (rib_read("/" BOOT_NAME "/dt/gam/type", &pg, sizeof(pg)) + if (rib_read(BOOT_PATH "/dt/gam/type", &pg, sizeof(pg)) != sizeof(pg)) { log_err("Failed to read policy for ribmgr gam."); return -1; } - if (rib_read("/" BOOT_NAME "/dt/gam/cacep", &pc, sizeof(pc)) + if (rib_read(BOOT_PATH "/dt/gam/cacep", &pc, sizeof(pc)) != sizeof(pc)) { log_err("Failed to read CACEP policy for ribmgr gam."); return -1; @@ -375,7 +376,7 @@ int fmgr_np1_alloc(int fd, assert(strlen(dst_ap_name) + strlen("/" DIR_NAME) + 1 < RIB_MAX_PATH_LEN); - strcpy(path, "/" DIR_NAME); + strcpy(path, DIR_PATH); rib_path_append(path, dst_ap_name); -- cgit v1.2.3