summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipip')
-rw-r--r--src/vnet/ipip/ipip.api2
-rw-r--r--src/vnet/ipip/ipip.c20
2 files changed, 15 insertions, 7 deletions
diff --git a/src/vnet/ipip/ipip.api b/src/vnet/ipip/ipip.api
index 4fbfa1d584e..2740a51aae1 100644
--- a/src/vnet/ipip/ipip.api
+++ b/src/vnet/ipip/ipip.api
@@ -49,7 +49,7 @@
*
*/
-option version = "2.0.1";
+option version = "2.0.2";
import "vnet/interface_types.api";
import "vnet/ip/ip_types.api";
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);