summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipip')
-rw-r--r--src/vnet/ipip/ipip.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/vnet/ipip/ipip.c b/src/vnet/ipip/ipip.c
index d43bcd1cb53..e6ea3ebe79d 100644
--- a/src/vnet/ipip/ipip.c
+++ b/src/vnet/ipip/ipip.c
@@ -335,14 +335,18 @@ ipip_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
ipip_tunnel_t *t;
adj_flags_t af;
+ af = ADJ_FLAG_NONE;
t = ipip_tunnel_db_find_by_sw_if_index (sw_if_index);
if (!t)
return;
- if (t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH)
- af = ADJ_FLAG_MIDCHAIN_FIXUP_FLOW_HASH;
- else
- af = ADJ_FLAG_MIDCHAIN_IP_STACK;
+ /*
+ * the user has not requested that the load-balancing be based on
+ * a flow hash of the inner packet. so use the stacking to choose
+ * a path.
+ */
+ if (!(t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH))
+ af |= ADJ_FLAG_MIDCHAIN_IP_STACK;
if (VNET_LINK_ETHERNET == adj_get_link_type (ai))
af |= ADJ_FLAG_MIDCHAIN_NO_COUNT;
@@ -372,10 +376,13 @@ 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;
+ /*
+ * the user has not requested that the load-balancing be based on
+ * a flow hash of the inner packet. so use the stacking to choose
+ * a path.
+ */
+ if (!(ctx->t->flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_INNER_HASH))
+ af |= ADJ_FLAG_MIDCHAIN_IP_STACK;
adj_nbr_midchain_update_rewrite
(ai, fixup,