aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp/sctp_output.c
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2018-03-28 12:06:10 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-28 13:40:04 +0000
commite17bb715cf19de48748241f2dcfde919ac0ecffa (patch)
treef530de9de2f1f152937d1761dad0c3d96d7837ad /src/vnet/sctp/sctp_output.c
parentab7c2b012d0132c63d700e036de801a1b7dc3340 (diff)
SCTP: use custom fib
Following TCP fixes from Florin (11430), this patch follows the same approach to indicate a fib (not just using the default one). Change-Id: Ib883aa0e9a1c6157acfea69c44426ba07d6c932a Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet/sctp/sctp_output.c')
-rw-r--r--src/vnet/sctp/sctp_output.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c
index f63519212ec..8ce94c6f3a2 100644
--- a/src/vnet/sctp/sctp_output.c
+++ b/src/vnet/sctp/sctp_output.c
@@ -362,7 +362,7 @@ sctp_enqueue_to_output_now (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
always_inline void
sctp_enqueue_to_ip_lookup_i (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
- u8 is_ip4, u8 flush)
+ u8 is_ip4, u32 fib_index, u8 flush)
{
sctp_main_t *tm = vnet_get_sctp_main ();
u32 thread_index = vlib_get_thread_index ();
@@ -372,8 +372,8 @@ sctp_enqueue_to_ip_lookup_i (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
b->error = 0;
- /* Default FIB for now */
- vnet_buffer (b)->sw_if_index[VLIB_TX] = 0;
+ vnet_buffer (b)->sw_if_index[VLIB_TX] = fib_index;
+ vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
/* Send to IP lookup */
next_index = is_ip4 ? ip4_lookup_node.index : ip6_lookup_node.index;
@@ -403,9 +403,9 @@ sctp_enqueue_to_ip_lookup_i (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
always_inline void
sctp_enqueue_to_ip_lookup (vlib_main_t * vm, vlib_buffer_t * b, u32 bi,
- u8 is_ip4)
+ u8 is_ip4, u32 fib_index)
{
- sctp_enqueue_to_ip_lookup_i (vm, b, bi, is_ip4, 0);
+ sctp_enqueue_to_ip_lookup_i (vm, b, bi, is_ip4, fib_index, 0);
}
/**
@@ -1342,7 +1342,8 @@ sctp_send_init (sctp_connection_t * sctp_conn)
sctp_prepare_init_chunk (sctp_conn, idx, b);
sctp_push_ip_hdr (tm, &sctp_conn->sub_conn[idx], b);
- sctp_enqueue_to_ip_lookup (vm, b, bi, sctp_conn->sub_conn[idx].c_is_ip4);
+ sctp_enqueue_to_ip_lookup (vm, b, bi, sctp_conn->sub_conn[idx].c_is_ip4,
+ sctp_conn->sub_conn[idx].c_fib_index);
/* Start the T1_INIT timer */
sctp_timer_set (sctp_conn, idx, SCTP_TIMER_T1_INIT,
@@ -1820,7 +1821,8 @@ sctp46_output_inline (vlib_main_t * vm,
}
vnet_buffer (b0)->sw_if_index[VLIB_RX] = 0;
- vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
+ vnet_buffer (b0)->sw_if_index[VLIB_TX] =
+ sctp_conn->sub_conn[idx].c_fib_index;
b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;