aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_pt_node.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_pt_node.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_pt_node.c')
-rw-r--r--src/vnet/srv6/sr_pt_node.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/srv6/sr_pt_node.c b/src/vnet/srv6/sr_pt_node.c
index 392101973d4..0a7f6fdb17b 100644
--- a/src/vnet/srv6/sr_pt_node.c
+++ b/src/vnet/srv6/sr_pt_node.c
@@ -38,8 +38,8 @@ format_pt_trace (u8 *s, va_list *args)
"outgoing interface load %u, t64_sec %u, t64_nsec %u, tts_template "
"%u, tts %u",
format_vnet_sw_if_index_name, vnet_get_main (), t->iface, t->id,
- t->load, htobe32 (t->t64.sec), htobe32 (t->t64.nsec), t->tts_template,
- t->tts);
+ t->load, clib_host_to_net_u32 (t->t64.sec),
+ clib_host_to_net_u32 (t->t64.nsec), t->tts_template, t->tts);
break;
default:
break;
@@ -65,7 +65,8 @@ pt_midpoint_processing (vlib_main_t *vm, vlib_node_runtime_t *node,
hbh_opt_pt = (void *) (hbh_opt + 1);
clib_memcpy_fast (&hbh_opt_pt->cmd_stack[1],
&hbh_opt_pt->cmd_stack[0], 33);
- hbh_opt_pt->cmd_stack[0].oif_oil = htobe16 (ls->id << 4);
+ hbh_opt_pt->cmd_stack[0].oif_oil =
+ clib_host_to_net_u16 (ls->id << 4);
hbh_opt_pt->cmd_stack[0].oif_oil |= ls->egress_load;
switch (ls->tts_template)
{
@@ -122,7 +123,7 @@ VLIB_NODE_FN (sr_pt_node)
to_next += 1;
n_left_from -= 1;
n_left_to_next -= 1;
- timestamp_64_t t64;
+ timestamp_64_t t64 = {};
b0 = vlib_get_buffer (vm, bi0);
iface = vnet_buffer (b0)->sw_if_index[VLIB_TX];