summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-03-29 18:54:04 +0000
committerFlorin Coras <fcoras@cisco.com>2020-04-01 20:24:38 +0000
commit0a1e183e5aa45fb0050eb03e1c8ebdb9f426a374 (patch)
treedc3a7789b55bebff61d566d54e4801536691bd7a /src/vnet/session
parent9076789779c5a038ec17936130a556703c234fa8 (diff)
session udp: support connect on listeners
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6aaaec20a2b6d4c6ddfbe659d9402acc1be2f7e2
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application_interface.h4
-rw-r--r--src/vnet/session/session_node.c1
-rw-r--r--src/vnet/session/session_types.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index bf946769028..b1ab847073a 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -387,6 +387,7 @@ typedef struct session_connect_msg_
u32 wrk_index;
u32 vrf;
u16 port;
+ u16 lcl_port;
u8 proto;
u8 is_ip4;
ip46_address_t ip;
@@ -681,7 +682,7 @@ app_recv_dgram_raw (svm_fifo_t * f, u8 * buf, u32 len,
int rv;
max_deq = svm_fifo_max_dequeue_cons (f);
- if (max_deq < sizeof (session_dgram_hdr_t))
+ if (max_deq <= sizeof (session_dgram_hdr_t))
{
if (clear_evt)
svm_fifo_unset_event (f);
@@ -699,6 +700,7 @@ app_recv_dgram_raw (svm_fifo_t * f, u8 * buf, u32 len,
rv = svm_fifo_peek (f, ph.data_offset + SESSION_CONN_HDR_LEN, len, buf);
if (peek)
return rv;
+ ASSERT (rv > 0);
ph.data_offset += rv;
if (ph.data_offset == ph.data_length)
svm_fifo_dequeue_drop (f, ph.data_length + SESSION_CONN_HDR_LEN);
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 2a4bb6b9425..66300bc6024 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -113,6 +113,7 @@ session_mq_connect_handler (void *data)
a->sep.transport_proto = mp->proto;
a->sep.peer.fib_index = mp->vrf;
clib_memcpy_fast (&a->sep.peer.ip, &mp->lcl_ip, sizeof (mp->lcl_ip));
+ a->sep.peer.port = mp->lcl_port;
a->sep.peer.sw_if_index = ENDPOINT_INVALID_INDEX;
a->sep_ext.parent_handle = mp->parent_handle;
a->sep_ext.ckpair_index = mp->ckpair_index;
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index aa0e8650747..a0360136b1d 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -21,7 +21,7 @@
#define SESSION_INVALID_INDEX ((u32)~0)
#define SESSION_INVALID_HANDLE ((u64)~0)
-#define SESSION_CTRL_MSG_MAX_SIZE 84
+#define SESSION_CTRL_MSG_MAX_SIZE 86
#define foreach_session_endpoint_fields \
foreach_transport_endpoint_cfg_fields \