summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip/node.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-11-25 13:04:44 +0000
committerOle Trøan <otroan@employees.org>2019-12-03 19:36:26 +0000
commit9534696b4637185c9f296375e63c50d8976d153d (patch)
tree7e5bce5d492b6b376e42f9df175e18202f93af68 /src/vnet/ipip/node.c
parentc8972fe506c78530a3e4085453e86a0b85b245ef (diff)
ipip: Tunnel flags controlling copying data to/from payload/encap
Type: feature Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I9467f11775936754406892b8e9e275f989ac9b30
Diffstat (limited to 'src/vnet/ipip/node.c')
-rw-r--r--src/vnet/ipip/node.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/vnet/ipip/node.c b/src/vnet/ipip/node.c
index 0cea4d50895..cd26b8a8b85 100644
--- a/src/vnet/ipip/node.c
+++ b/src/vnet/ipip/node.c
@@ -158,9 +158,33 @@ ipip_input (vlib_main_t * vm, vlib_node_runtime_t * node,
vnet_buffer (b0)->sw_if_index[VLIB_RX] = tunnel_sw_if_index;
if (inner_protocol0 == IP_PROTOCOL_IPV6)
- next0 = IPIP_INPUT_NEXT_IP6_INPUT;
+ {
+ next0 = IPIP_INPUT_NEXT_IP6_INPUT;
+
+ if (t0->flags & IPIP_TUNNEL_FLAG_DECAP_COPY_ECN)
+ {
+ if (is_ipv6)
+ ip6_set_ecn_network_order ((ip60 + 1),
+ ip6_ecn_network_order (ip60));
+ else
+ ip6_set_ecn_network_order ((ip6_header_t *) (ip40 + 1),
+ ip4_header_get_ecn (ip40));
+ }
+ }
else if (inner_protocol0 == IP_PROTOCOL_IP_IN_IP)
- next0 = IPIP_INPUT_NEXT_IP4_INPUT;
+ {
+ next0 = IPIP_INPUT_NEXT_IP4_INPUT;
+ if (t0->flags & IPIP_TUNNEL_FLAG_DECAP_COPY_ECN)
+ {
+ if (is_ipv6)
+ ip4_header_set_ecn_w_chksum ((ip4_header_t *) (ip60 + 1),
+ ip6_ecn_network_order
+ (ip60));
+ else
+ ip4_header_set_ecn_w_chksum (ip40 + 1,
+ ip4_header_get_ecn (ip40));
+ }
+ }
if (!is_ipv6 && t0->mode == IPIP_MODE_6RD
&& t0->sixrd.security_check)