X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fioam%2Flib-vxlan-gpe%2Fvxlan_gpe_ioam_trace.c;h=e758b522ba0c20afae43eafac8c7b7366f0d3cca;hb=756cd9441752fc8f84104c9ee19099506ba89f85;hp=e37b1642d96fdb2b1747b580c243053ff91652fe;hpb=cb034b9b374927c7552e36dcbc306d8456b2a0cb;p=vpp.git diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_trace.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_trace.c index e37b1642d96..e758b522ba0 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_trace.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_trace.c @@ -25,6 +25,7 @@ #include #include +#include #include /* Timestamp precision multipliers for seconds, milliseconds, microseconds @@ -88,7 +89,7 @@ vxlan_gpe_ioam_add_register_option (u8 option, { vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main; - ASSERT (option < ARRAY_LEN (hm->add_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->add_options)); /* Already registered */ if (hm->add_options[option]) @@ -105,7 +106,7 @@ vxlan_gpe_add_unregister_option (u8 option) { vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main; - ASSERT (option < ARRAY_LEN (hm->add_options)); + ASSERT ((u32) option < ARRAY_LEN (hm->add_options)); /* Not registered */ if (!hm->add_options[option]) @@ -127,7 +128,7 @@ vxlan_gpe_ioam_register_option (u8 option, { vxlan_gpe_ioam_main_t *im = &vxlan_gpe_ioam_main; - ASSERT (option < ARRAY_LEN (im->options)); + ASSERT ((u32) option < ARRAY_LEN (im->options)); /* Already registered */ if (im->options[option]) @@ -144,7 +145,7 @@ vxlan_gpe_ioam_unregister_option (u8 option) { vxlan_gpe_ioam_main_t *hm = &vxlan_gpe_ioam_main; - ASSERT (option < ARRAY_LEN (hm->options)); + ASSERT ((u32) option < ARRAY_LEN (hm->options)); /* Not registered */ if (!hm->options[option]) @@ -301,11 +302,10 @@ vxlan_gpe_ioam_trace_data_list_handler (vlib_buffer_t * b, { u16 tx_if = 0; u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX]; - ip4_main_t *im4 = &ip4_main; - ip_lookup_main_t *lm = &im4->lookup_main; + if (use_adj) { - ip_adjacency_t *adj = ip_get_adjacency (lm, adj_index); + ip_adjacency_t *adj = adj_get (adj_index); tx_if = adj->rewrite_header.sw_if_index & 0xFFFF; } @@ -329,11 +329,10 @@ vxlan_gpe_ioam_trace_data_list_handler (vlib_buffer_t * b, { u16 tx_if = 0; u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX]; - ip6_main_t *im6 = &ip6_main; - ip_lookup_main_t *lm = &im6->lookup_main; + if (use_adj) { - ip_adjacency_t *adj = ip_get_adjacency (lm, adj_index); + ip_adjacency_t *adj = adj_get (adj_index); tx_if = adj->rewrite_header.sw_if_index & 0xFFFF; }