aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliuyacan <liuyacan@corp.netease.com>2021-08-16 10:51:13 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-08-30 13:55:55 +0000
commit1b6b09bb514831050b23397c078933c2ace3ff36 (patch)
tree39b6befa9bc9af7f03302c37d3af6f44636a4709
parent7da9b5be41395cc6355f9cf278106aae7fd9f991 (diff)
tcp: Allow accepting session to send custom packet
Tcp may want to send acks in established, but the app has not called accept() yet. Type: improvement Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I43b8cd386e533ca95c8ec260a0a1f695ea140358
-rw-r--r--src/vnet/session/session_node.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index b8b5ce2d8de..969f88c7e36 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1018,7 +1018,15 @@ session_tx_not_ready (session_t * s, u8 peek_data)
/* Can retransmit for closed sessions but can't send new data if
* session is not ready or closed */
else if (s->session_state < SESSION_STATE_READY)
- return 1;
+ {
+ /* Allow accepting session to send custom packets.
+ * For instance, tcp want to send acks in established, but
+ * the app has not called accept() yet */
+ if (s->session_state == SESSION_STATE_ACCEPTING &&
+ (s->flags & SESSION_F_CUSTOM_TX))
+ return 0;
+ return 1;
+ }
else if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSED)
{
/* Allow closed transports to still send custom packets.