summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-06-14 10:57:29 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-06-15 09:52:31 +0200
commit4356a8dce299eb84cbafa2edd0bbd252a6a4c335 (patch)
tree5114cdf02bd94cf3900eb1cc56c67d5713f19947 /src/ipcpd/normal
parent47c922f1360990f2da8363aafa0798551a2128ef (diff)
downloadouroboros-4356a8dce299eb84cbafa2edd0bbd252a6a4c335.tar.gz
ouroboros-4356a8dce299eb84cbafa2edd0bbd252a6a4c335.zip
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 <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/ipcpd/normal')
-rw-r--r--src/ipcpd/normal/dt.c5
1 files changed, 3 insertions, 2 deletions
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 <inttypes.h>
#include <assert.h>
-#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;