summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6
diff options
context:
space:
mode:
authorAhmed Abdelsalam <ahabdels@cisco.com>2022-06-29 17:11:08 +0000
committerDamjan Marion <dmarion@0xa5.net>2022-06-30 13:27:28 +0000
commitd50e661d661ba96dd5e8b64f47d5d252dea8284b (patch)
tree551439e2dfb007130b183f011953480e45697f71 /src/vnet/srv6
parentcd758e6af56f7ad94c60066729d9bc8d0c4efe0b (diff)
sr: SRv6 Path Tracing Sink node behavior
Type: feature Signed-off-by: Ahmed Abdelsalam <ahabdels@cisco.com> Change-Id: I2d3a0211abfee3501d3d77c80da20e67e1e9e133
Diffstat (limited to 'src/vnet/srv6')
-rw-r--r--src/vnet/srv6/sr_policy_rewrite.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index 0134f3c083b..12e7f084c8c 100644
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -47,6 +47,7 @@
#include <vnet/fib/ip6_fib.h>
#include <vnet/dpo/dpo.h>
#include <vnet/dpo/replicate_dpo.h>
+#include <vnet/srv6/sr_pt.h>
#include <vppinfra/error.h>
#include <vppinfra/elog.h>
@@ -1282,6 +1283,8 @@ srv6_tef_behavior (vlib_node_runtime_t *node, vlib_buffer_t *b0,
ip6_sr_header_t *srh;
ip6_sr_pt_tlv_t *srh_pt_tlv;
timestamp_64_t ts;
+ sr_pt_iface_t *ls = 0;
+ u16 id_ld = 0;
srh = (ip6_sr_header_t *) (ip0 + 1);
srh_pt_tlv =
@@ -1292,6 +1295,13 @@ srv6_tef_behavior (vlib_node_runtime_t *node, vlib_buffer_t *b0,
unix_time_now_nsec_fraction (&ts.sec, &ts.nsec);
srh_pt_tlv->t64.sec = htobe32 (ts.sec);
srh_pt_tlv->t64.nsec = htobe32 (ts.nsec);
+ ls = sr_pt_find_iface (vnet_buffer (b0)->sw_if_index[VLIB_RX]);
+ if (ls)
+ {
+ id_ld = ls->id << 4;
+ id_ld |= ls->ingress_load;
+ srh_pt_tlv->id_ld = htobe16 (id_ld);
+ }
}
/**