summaryrefslogtreecommitdiffstats
path: root/extras/libmemif/src/socket.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-03-28 10:21:05 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-28 13:35:40 +0000
commitab7c2b012d0132c63d700e036de801a1b7dc3340 (patch)
treeb02973c00f8cc37f3423542f1206a11e9cc3a10a /extras/libmemif/src/socket.c
parentea2600ae6adbdb30bc66c9415bf19fe41a3af4f0 (diff)
libmemif: add private header size field
Change-Id: I09567c8ee9c92e91918840f80942a005069d9842 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'extras/libmemif/src/socket.c')
-rw-r--r--extras/libmemif/src/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extras/libmemif/src/socket.c b/extras/libmemif/src/socket.c
index 8f18d892139..a471e0ba943 100644
--- a/extras/libmemif/src/socket.c
+++ b/extras/libmemif/src/socket.c
@@ -227,6 +227,7 @@ memif_msg_enq_add_ring (memif_connection_t * c, uint8_t index, uint8_t dir)
ar->region = mq->region;
ar->log2_ring_size = mq->log2_ring_size;
ar->flags = (dir == MEMIF_RING_S2M) ? MEMIF_MSG_ADD_RING_FLAG_S2M : 0;
+ ar->private_hdr_size = 0;
e->next = NULL;
if (c->msg_queue == NULL)
@@ -516,6 +517,9 @@ memif_msg_receive_add_ring (memif_connection_t * c, memif_msg_t * msg, int fd)
if (fd < 0)
return MEMIF_ERR_NO_INTFD;
+ if (ar->private_hdr_size != 0)
+ return MEMIF_ERR_PRIVHDR;
+
if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M)
{
if (ar->index > MEMIF_MAX_S2M_RING)