summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-03-16 13:07:15 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-16 13:44:08 +0100
commita6a83171d5c7d09301ffd52ac9ea5c67758714ee (patch)
treebe106853b1ff89b7a7686cda2114dea28f662693
parent67729ef3efaa7925816a82688744c8c5c29f4ce3 (diff)
downloadouroboros-a6a83171d5c7d09301ffd52ac9ea5c67758714ee.tar.gz
ouroboros-a6a83171d5c7d09301ffd52ac9ea5c67758714ee.zip
ipcpd: Fix reading LSAs in link-state policy0.10.7
The read buffer had the exact length of a link-state message. With the partial read implemented, we should then do another read() to check if there are more parts of the message (which will return 0). To avoid the additional read() call every time, the buffer was extended by 1 byte. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/ipcpd/normal/pol/link_state.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46260e90..0bdcec48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ include(GNUInstallDirs)
set(PACKAGE_VERSION_MAJOR 0)
set(PACKAGE_VERSION_MINOR 10)
-set(PACKAGE_VERSION_PATCH 6)
+set(PACKAGE_VERSION_PATCH 7)
set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(PACKAGE_DESCRIPTION "The Ouroboros prototype")
diff --git a/src/ipcpd/normal/pol/link_state.c b/src/ipcpd/normal/pol/link_state.c
index 61469b94..7aa7faf7 100644
--- a/src/ipcpd/normal/pol/link_state.c
+++ b/src/ipcpd/normal/pol/link_state.c
@@ -655,7 +655,7 @@ static void * lsreader(void * o)
{
fqueue_t * fq;
int ret;
- uint8_t buf[sizeof(struct lsa)];
+ uint8_t buf[sizeof(struct lsa) + 1];
int fd;
qosspec_t qs;
struct lsa * msg;
@@ -680,7 +680,7 @@ static void * lsreader(void * o)
}
while ((fd = fqueue_next(fq)) >= 0) {
- len = flow_read(fd, buf, sizeof(*msg));
+ len = flow_read(fd, buf, sizeof(*msg) + 1);
if (len <= 0 || len != sizeof(*msg))
continue;