aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorTarun Gupta <tarungup@cisco.com>2019-11-04 16:35:59 -0800
committerFlorin Coras <florin.coras@gmail.com>2019-11-06 00:42:41 +0000
commit2089c69efbc4ae5c64cab8a5418187b21478987a (patch)
treeeefd1469bf359d3e176e8ae352ec78c395dbc4aa /src/vnet/tcp/tcp_output.c
parentead1e536d66d83b546528c32e2112085a97c8e13 (diff)
tcp: IPv6 flow label support
Type:feature For cases when proxy is in use IPv6 flow label received in origin pkt needs to be added to ipv6 header of outgoing pkts from proxy to original destination and vice versa. Signed-off-by: Tarun Gupta <tarungup@cisco.com> Change-Id: I143f7e67237c0f865333078628a016b50ad5e630 Signed-off-by: Tarun Gupta <tarungup@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 71e9d7bbdb0..c7e9792afaa 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -842,8 +842,10 @@ tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt,
int bogus = ~0;
ASSERT ((pkt_ih6->ip_version_traffic_class_and_flow_label & 0xF0) ==
0x60);
- ih6 = vlib_buffer_push_ip6 (vm, b, &pkt_ih6->dst_address,
- &pkt_ih6->src_address, IP_PROTOCOL_TCP);
+ ih6 = vlib_buffer_push_ip6_custom (vm, b, &pkt_ih6->dst_address,
+ &pkt_ih6->src_address,
+ IP_PROTOCOL_TCP,
+ tc->ipv6_flow_label);
th->checksum = ip6_tcp_udp_icmp_compute_checksum (vm, b, ih6, &bogus);
ASSERT (!bogus);
}
@@ -909,8 +911,9 @@ tcp_push_ip_hdr (tcp_worker_ctx_t * wrk, tcp_connection_t * tc,
ip6_header_t *ih;
int bogus = ~0;
- ih = vlib_buffer_push_ip6 (vm, b, &tc->c_lcl_ip6,
- &tc->c_rmt_ip6, IP_PROTOCOL_TCP);
+ ih = vlib_buffer_push_ip6_custom (vm, b, &tc->c_lcl_ip6,
+ &tc->c_rmt_ip6, IP_PROTOCOL_TCP,
+ tc->ipv6_flow_label);
th->checksum = ip6_tcp_udp_icmp_compute_checksum (vm, b, ih, &bogus);
ASSERT (!bogus);
}
@@ -2278,8 +2281,9 @@ tcp_output_push_ip (vlib_main_t * vm, vlib_buffer_t * b0,
ih0 = vlib_buffer_push_ip4 (vm, b0, &tc0->c_lcl_ip4, &tc0->c_rmt_ip4,
IP_PROTOCOL_TCP, tcp_csum_offload (tc0));
else
- ih0 = vlib_buffer_push_ip6 (vm, b0, &tc0->c_lcl_ip6, &tc0->c_rmt_ip6,
- IP_PROTOCOL_TCP);
+ ih0 =
+ vlib_buffer_push_ip6_custom (vm, b0, &tc0->c_lcl_ip6, &tc0->c_rmt_ip6,
+ IP_PROTOCOL_TCP, tc0->ipv6_flow_label);
}