summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip/node.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-12-31 05:13:14 +0000
committerDamjan Marion <dmarion@me.com>2020-01-30 20:12:19 +0000
commite5b94dded0dfd7258d5fd0f4ef897d9ccb48715b (patch)
tree819c62a17acf0b234a76c8eef2f00e944e1da8b3 /src/vnet/ipip/node.c
parent9ace36d0f9b04e2d4db410607ee33a8e72ef00c5 (diff)
gre: Tunnel encap/decap flags
Type: feature common funcitons across IP-in-IP and GRE tunnels for encap/decap functions Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I325b66824878d843af167adfe5a7a96b0ab90566
Diffstat (limited to 'src/vnet/ipip/node.c')
-rw-r--r--src/vnet/ipip/node.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/vnet/ipip/node.c b/src/vnet/ipip/node.c
index 0f47f2636db..baaeee863fc 100644
--- a/src/vnet/ipip/node.c
+++ b/src/vnet/ipip/node.c
@@ -19,7 +19,7 @@
#include <vnet/ipip/ipip.h>
#include <vnet/ip/ip6_packet.h>
#include <vnet/mpls/mpls.h>
-#include <vnet/pg/pg.h>
+#include <vnet/tunnel/tunnel_dp.h>
#include <vppinfra/sparse_vec.h>
#define foreach_ipip_input_next \
@@ -159,29 +159,21 @@ ipip_input (vlib_main_t * vm, vlib_node_runtime_t * node,
{
next0 = IPIP_INPUT_NEXT_IP6_INPUT;
- if (t0->flags & TUNNEL_ENCAP_DECAP_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));
- }
+ if (is_ipv6)
+ tunnel_decap_fixup_6o6 (t0->flags, (ip60 + 1), ip60);
+ else
+ tunnel_decap_fixup_6o4 (t0->flags,
+ (ip6_header_t *) (ip40 + 1), ip40);
}
else if (inner_protocol0 == IP_PROTOCOL_IP_IN_IP)
{
next0 = IPIP_INPUT_NEXT_IP4_INPUT;
- if (t0->flags & TUNNEL_ENCAP_DECAP_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)
+ tunnel_decap_fixup_4o6 (t0->flags,
+ (ip4_header_t *) (ip60 + 1), ip60);
+ else
+ tunnel_decap_fixup_4o4 (t0->flags, ip40 + 1, ip40);
}
if (!is_ipv6 && t0->mode == IPIP_MODE_6RD