Span node configuration fix 21/3921/2
authorChristophe Fontaine <christophe.fontaine@qosmos.com>
Tue, 22 Nov 2016 13:52:57 +0000 (14:52 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 22 Nov 2016 21:10:56 +0000 (21:10 +0000)
Prefer to use the sw_if_index instead of the hw_if_index
to be compatible with vhost-user interfaces.

Change-Id: Id1e4255a992d428b8de47b3dd6175ed86e08c803
Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
vnet/vnet/span/span.c

index de43af0..5230045 100644 (file)
@@ -32,11 +32,11 @@ span_add_delete_entry (vlib_main_t * vm,
   vnet_sw_interface_t *sw =
     vnet_get_sw_interface (sm->vnet_main, src_sw_if_index);
 
-  vec_validate_aligned (sm->dst_by_src_sw_if_index, sw->hw_if_index,
+  vec_validate_aligned (sm->dst_by_src_sw_if_index, sw->sw_if_index,
                        CLIB_CACHE_LINE_BYTES);
-  sm->dst_by_src_sw_if_index[sw->hw_if_index] = is_add ? dst_sw_if_index : 0;
+  sm->dst_by_src_sw_if_index[sw->sw_if_index] = is_add ? dst_sw_if_index : 0;
   vnet_feature_enable_disable ("device-input", "span-input",
-                              sw->hw_if_index, is_add, 0, 0);
+                              sw->sw_if_index, is_add, 0, 0);
   return 0;
 }