session: increase max ctrl msg size 87/22787/3
authorFlorin Coras <fcoras@cisco.com>
Wed, 16 Oct 2019 18:21:41 +0000 (11:21 -0700)
committerFlorin Coras <florin.coras@gmail.com>
Wed, 16 Oct 2019 22:42:54 +0000 (22:42 +0000)
Type: fix

Connect ctrl message recently outgrew the maximum ctrl msg size, so
increase the limit. Also add static asserts for messages that could
potentially exceed the limit.

Change-Id: I0d3e32e0d4d67d7e222cff14ddba59a0c3fb8b00
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session/application_interface.h
src/vnet/session/session.h
src/vnet/session/session_types.h

index e5e36b8..d907287 100644 (file)
@@ -298,6 +298,9 @@ typedef struct session_listen_msg_
   u32 ckpair_index;
 } __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;
@@ -305,6 +308,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;
@@ -371,6 +377,9 @@ typedef struct session_connect_msg_
   u32 ckpair_index;
 } __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;
@@ -378,6 +387,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;
index cb0cac7..1d3ae0c 100644 (file)
@@ -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;
index bb309f2..c2bb4dd 100644 (file)
@@ -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                                \