tcp: remove erroneous exception seg check assert 92/42792/3
authorFlorin Coras <[email protected]>
Mon, 14 Apr 2025 02:50:51 +0000 (22:50 -0400)
committerDave Barach <[email protected]>
Mon, 14 Apr 2025 16:52:29 +0000 (16:52 +0000)
Type: fix

Change-Id: Ic3ae960e8f4a28f96b9964f6a3bd60379dd3795f
Signed-off-by: Florin Coras <[email protected]>
src/vnet/tcp/tcp_input.c

index 2d43cf0..7977a6c 100644 (file)
@@ -1361,10 +1361,9 @@ tcp_established_trace_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
 always_inline int
 tcp_segment_is_exception (tcp_connection_t *tc, tcp_header_t *th)
 {
-  /* TODO(fcoras): tcp-input should not allow segments without one of ack, rst,
-   * syn flags, so we shouldn't be checking for their presence. Leave the check
-   * in for now, remove in due time */
-  ASSERT (th->flags & (TCP_FLAG_ACK | TCP_FLAG_RST | TCP_FLAG_SYN));
+  /* tcp-input allows through segments without ack, e.g., fin without ack,
+   * which have to be handled as exception in nodes like established. So
+   * flags must be checked */
   return !tc || tc->state == TCP_STATE_CLOSED ||
         !(th->flags & (TCP_FLAG_ACK | TCP_FLAG_RST | TCP_FLAG_SYN));
 }