summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_entry_src.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-05-02 10:15:19 -0700
committerDave Barach <openvpp@barachs.net>2017-05-02 21:53:54 +0000
commit41da54f501338072ec9543db2e07e2c046e3964e (patch)
tree9cd90d4847792ae8eeef002e4d273a50b62553cc /src/vnet/fib/fib_entry_src.c
parent4269098e14603e38936ea7351705373ad55c08a7 (diff)
Use per-protocol default flow-hash config when the FIB table index is not known
Change-Id: If088e75801831befc6bddb77ea20abe9288b93c4 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_entry_src.c')
-rw-r--r--src/vnet/fib/fib_entry_src.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vnet/fib/fib_entry_src.c b/src/vnet/fib/fib_entry_src.c
index fd80497c453..ab72565d903 100644
--- a/src/vnet/fib/fib_entry_src.c
+++ b/src/vnet/fib/fib_entry_src.c
@@ -447,9 +447,24 @@ fib_entry_src_mk_lb (fib_entry_t *fib_entry,
else
{
flow_hash_config_t fhc;
+ fib_protocol_t fp;
- fhc = fib_table_get_flow_hash_config(fib_entry->fe_fib_index,
- dpo_proto_to_fib(lb_proto));
+ /*
+ * if the protocol for the LB we are building does not match that
+ * of the fib_entry (i.e. we are build the [n]EOS LB for an IPv[46]
+ * then the fib_index is not an index that relates to the table
+ * type we need. So get the default flow-hash config instead.
+ */
+ fp = dpo_proto_to_fib(lb_proto);
+
+ if (fib_entry->fe_prefix.fp_proto != fp)
+ {
+ fhc = fib_table_get_default_flow_hash_config(fp);
+ }
+ else
+ {
+ fhc = fib_table_get_flow_hash_config(fib_entry->fe_fib_index, fp);
+ }
dpo_set(dpo_lb,
DPO_LOAD_BALANCE,
lb_proto,