aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_interface.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-06 21:28:59 +0000
committerDave Barach <openvpp@barachs.net>2020-04-07 14:46:47 +0000
commitba78e2380e86926c7e29bc3538eb7ac4e78699b1 (patch)
treef673f105517a6c63a75574cb597f61b966366570 /src/vnet/session/application_interface.h
parent59fea5a6a3fafe0a5a0d2f543db53af790013e3a (diff)
udp session: jumbo frames and configurable mtu
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6b750bef5df0f8544e05177ccd480f87a020832d
Diffstat (limited to 'src/vnet/session/application_interface.h')
-rw-r--r--src/vnet/session/application_interface.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index b410c638155..d09432d0b52 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -694,8 +694,13 @@ app_recv_dgram_raw (svm_fifo_t * f, u8 * buf, u32 len,
svm_fifo_peek (f, 0, sizeof (ph), (u8 *) & ph);
ASSERT (ph.data_length >= ph.data_offset);
- svm_fifo_peek (f, sizeof (ph), sizeof (*at), (u8 *) at);
+ /* Check if we have the full dgram */
+ if (max_deq < (ph.data_length + SESSION_CONN_HDR_LEN)
+ && len >= ph.data_length)
+ return 0;
+
+ svm_fifo_peek (f, sizeof (ph), sizeof (*at), (u8 *) at);
len = clib_min (len, ph.data_length - ph.data_offset);
rv = svm_fifo_peek (f, ph.data_offset + SESSION_CONN_HDR_LEN, len, buf);
if (peek)