From 4356a8dce299eb84cbafa2edd0bbd252a6a4c335 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 14 Jun 2018 10:57:29 +0200 Subject: ipcpd: Fix RIB output for dt component The RIB output length was fixed for 3 qos cubes. Now it will scale correctly if QoS cubes are added or removed. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/dt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/normal') diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c index 9ab16460..397169f3 100644 --- a/src/ipcpd/normal/dt.c +++ b/src/ipcpd/normal/dt.c @@ -56,7 +56,8 @@ #include #include -#define STAT_FILE_LEN 2205 +#define QOS_BLOCK_LEN 672 +#define STAT_FILE_LEN (189 + QOS_BLOCK_LEN * QOS_CUBE_MAX) #ifndef CLOCK_REALTIME_COARSE #define CLOCK_REALTIME_COARSE CLOCK_REALTIME @@ -110,7 +111,7 @@ static int dt_stat_read(const char * path, #ifdef IPCP_FLOW_STATS int fd; int i; - char str[681]; + char str[QOS_BLOCK_LEN + 1]; char addrstr[20]; char tmstr[20]; size_t rxqlen = 0; -- cgit v1.2.3