summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application_interface.h12
-rw-r--r--src/vnet/session/session.h2
-rw-r--r--src/vnet/session/session_types.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index 015a297f852..748b1b5b52a 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -273,6 +273,9 @@ typedef struct session_listen_msg_
ip46_address_t ip;
} __clib_packed session_listen_msg_t;
+STATIC_ASSERT (sizeof (session_listen_msg_t) <= SESSION_CTRL_MSG_MAX_SIZE,
+ "msg too large");
+
typedef struct session_listen_uri_msg_
{
u32 client_index;
@@ -280,6 +283,9 @@ typedef struct session_listen_uri_msg_
u8 uri[56];
} __clib_packed session_listen_uri_msg_t;
+STATIC_ASSERT (sizeof (session_listen_uri_msg_t) <= SESSION_CTRL_MSG_MAX_SIZE,
+ "msg too large");
+
typedef struct session_bound_msg_
{
u32 context;
@@ -345,6 +351,9 @@ typedef struct session_connect_msg_
u64 parent_handle;
} __clib_packed session_connect_msg_t;
+STATIC_ASSERT (sizeof (session_connect_msg_t) <= SESSION_CTRL_MSG_MAX_SIZE,
+ "msg too large");
+
typedef struct session_connect_uri_msg_
{
u32 client_index;
@@ -352,6 +361,9 @@ typedef struct session_connect_uri_msg_
u8 uri[56];
} __clib_packed session_connect_uri_msg_t;
+STATIC_ASSERT (sizeof (session_connect_uri_msg_t) <=
+ SESSION_CTRL_MSG_MAX_SIZE, "msg too large");
+
typedef struct session_connected_msg_
{
u32 context;
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index cb0cac7cda6..1d3ae0ca4b2 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -62,8 +62,6 @@ typedef struct session_tx_context_
session_dgram_hdr_t hdr;
} session_tx_context_t;
-#define SESSION_CTRL_MSG_MAX_SIZE 64
-
typedef struct session_evt_elt
{
clib_llist_anchor_t evt_list;
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index bf45855e264..17a03403c97 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -21,6 +21,7 @@
#define SESSION_INVALID_INDEX ((u32)~0)
#define SESSION_INVALID_HANDLE ((u64)~0)
+#define SESSION_CTRL_MSG_MAX_SIZE 68
#define foreach_session_endpoint_fields \
foreach_transport_endpoint_cfg_fields \