summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_api.c
diff options
context:
space:
mode:
authorAhmed Abdelsalam <ahabdels@cisco.com>2019-12-08 12:58:27 +0100
committerNeale Ranns <nranns@cisco.com>2020-01-16 20:31:08 +0000
commit13e6fce7c5b3a16a6af0b27fc259ef3f65d8c861 (patch)
tree6e35602be83b56adf71e1a96b4aa742c9418f25e /src/vnet/srv6/sr_api.c
parent1bf83b9d9bd9013cd07435c5bf0c5a584906857a (diff)
sr: some fixes for SRv6 CLI/API
Return FIB table_id instead of vrf_index to clients Type: fix Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com> Change-Id: I76a97bad3ecd3ac8eb045efb1657eaa90c2a57b6
Diffstat (limited to 'src/vnet/srv6/sr_api.c')
-rw-r--r--src/vnet/srv6/sr_api.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vnet/srv6/sr_api.c b/src/vnet/srv6/sr_api.c
index ffd0c4d0400..606eaa612ae 100644
--- a/src/vnet/srv6/sr_api.c
+++ b/src/vnet/srv6/sr_api.c
@@ -24,6 +24,7 @@
#include <vnet/interface.h>
#include <vnet/api_errno.h>
#include <vnet/feature/feature.h>
+#include <vnet/fib/fib_table.h>
#include <vnet/vnet_msg_enum.h>
@@ -239,7 +240,16 @@ static void send_sr_localsid_details
else
clib_memcpy (rmp->xconnect_nh_addr6, &t->next_hop.ip6,
sizeof (ip6_address_t));
- rmp->xconnect_iface_or_vrf_table = htonl (t->sw_if_index);
+
+ if (t->behavior == SR_BEHAVIOR_T || t->behavior == SR_BEHAVIOR_DT6)
+ rmp->xconnect_iface_or_vrf_table =
+ htonl (fib_table_get_table_id (t->sw_if_index, FIB_PROTOCOL_IP6));
+ else if (t->behavior == SR_BEHAVIOR_DT4)
+ rmp->xconnect_iface_or_vrf_table =
+ htonl (fib_table_get_table_id (t->sw_if_index, FIB_PROTOCOL_IP4));
+ else
+ rmp->xconnect_iface_or_vrf_table = htonl (t->sw_if_index);
+
rmp->context = context;
vl_api_send_msg (reg, (u8 *) rmp);