aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip/ipip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipip/ipip.c')
-rw-r--r--src/vnet/ipip/ipip.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vnet/ipip/ipip.c b/src/vnet/ipip/ipip.c
index 87aba12ca89..357eb58f160 100644
--- a/src/vnet/ipip/ipip.c
+++ b/src/vnet/ipip/ipip.c
@@ -288,7 +288,11 @@ ipip_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
if (!t)
return;
- af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+ if (t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
+ af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
+ else
+ af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+
if (VNET_LINK_ETHERNET == adj_get_link_type (ai))
af |= ADJ_FLAG_MIDCHAIN_NO_COUNT;
@@ -317,14 +321,18 @@ mipip_mk_complete_walk (adj_index_t ai, void *data)
af = ADJ_FLAG_NONE;
fixup = ipip_get_fixup (ctx->t, adj_get_link_type (ai), &af);
+ if (ctx->t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
+ af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
+ else
+ af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+
adj_nbr_midchain_update_rewrite
(ai, fixup,
uword_to_pointer (ctx->t->flags, void *),
- ADJ_FLAG_MIDCHAIN_IP_STACK, ipip_build_rewrite (vnet_get_main (),
- ctx->t->sw_if_index,
- adj_get_link_type (ai),
- &teib_entry_get_nh
- (ctx->ne)->fp_addr));
+ af, ipip_build_rewrite (vnet_get_main (),
+ ctx->t->sw_if_index,
+ adj_get_link_type (ai),
+ &teib_entry_get_nh (ctx->ne)->fp_addr));
teib_entry_adj_stack (ctx->ne, ai);