summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_policy_rewrite.c
diff options
context:
space:
mode:
authorGuillaume Solignac <gsoligna@cisco.com>2023-01-06 13:55:04 +0100
committerDave Wallace <dwallacelf@gmail.com>2023-01-10 23:09:01 +0000
commit897fbba43424f04d5f50cecc5856d5462d37fad3 (patch)
treec744bf8bfdf9043a09712375302c611fdfe3ab4f /src/vnet/srv6/sr_policy_rewrite.c
parent1ee30fd5d2d58d2d6a734dff62a9852236b8b2cf (diff)
sr: fix compilation errors
Uses VPP's clib_host_to_net functions, and initializes a potentially uninitialized variable. Type: fix Signed-off-by: Guillaume Solignac <gsoligna@cisco.com> Change-Id: Ie6b035c698f57ff39aeb955b35db8ec40f383b7a
Diffstat (limited to 'src/vnet/srv6/sr_policy_rewrite.c')
-rw-r--r--src/vnet/srv6/sr_policy_rewrite.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index 12e7f084c8c..8ad857153e4 100644
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -49,6 +49,7 @@
#include <vnet/dpo/replicate_dpo.h>
#include <vnet/srv6/sr_pt.h>
+#include <vppinfra/byte_order.h>
#include <vppinfra/error.h>
#include <vppinfra/elog.h>
@@ -1293,14 +1294,14 @@ srv6_tef_behavior (vlib_node_runtime_t *node, vlib_buffer_t *b0,
sizeof (ip6_address_t) * (srh->last_entry + 1));
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);
+ srh_pt_tlv->t64.sec = clib_host_to_net_u32 (ts.sec);
+ srh_pt_tlv->t64.nsec = clib_host_to_net_u32 (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);
+ srh_pt_tlv->id_ld = clib_host_to_net_u16 (id_ld);
}
}