From 540a8dacbe0da88fde97a6c1201d6e1ba95c5cf6 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 18 Jun 2019 08:55:14 -0700 Subject: [PATCH] tcp: allow custom output next node Type: feature Change-Id: If9804d3685d2a52efa06e412ae1ebb39c6a44b8b Signed-off-by: Florin Coras --- src/vnet/tcp/tcp.h | 1 + src/vnet/tcp/tcp_output.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index aeae57c6c6d..132ec13892d 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -323,6 +323,7 @@ typedef struct _tcp_connection u32 tx_fifo_size; /**< Tx fifo size. Used to constrain cwnd */ u32 psh_seq; /**< Add psh header for seg that includes this */ + u32 out_next_index; /**< Can be used to control next node in output */ } tcp_connection_t; /* *INDENT-OFF* */ diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 77065cd5200..abd674d94be 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -2062,6 +2062,9 @@ tcp_output_handle_packet (tcp_connection_t * tc0, vlib_buffer_t * b0, return; } + /* If next_index is not drop use it */ + *next0 = tc0->out_next_index ? tc0->out_next_index : *next0; + vnet_buffer (b0)->sw_if_index[VLIB_TX] = tc0->c_fib_index; vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0; -- 2.16.6