From 6a0b7e3970f3f4c729112a809665cc2b6a074037 Mon Sep 17 00:00:00 2001 From: Vengada Date: Fri, 27 Jan 2017 01:57:46 -0800 Subject: Cleanup some obfuscated code in next node handling. The values of next node can be simply assigned by dereferencing the pointer instead of obfuscating the dereference. Change-Id: I1f4a3d51b768960699010591410695473728d3a2 Signed-off-by: Vengada --- src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c') diff --git a/src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c b/src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c index 55c33b144a1..7a4580d804f 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c +++ b/src/plugins/ioam/lib-vxlan-gpe/ioam_pop.c @@ -151,7 +151,7 @@ vxlan_gpe_pop_ioam_v4_one_inline (vlib_main_t * vm, */ if (gpe_ioam0->length > clib_net_to_host_u16 (ip0->length)) { - next0[0] = VXLAN_GPE_INPUT_NEXT_DROP; + *next0 = VXLAN_GPE_INPUT_NEXT_DROP; goto trace00; } @@ -172,7 +172,7 @@ vxlan_gpe_pop_ioam_v4_one_inline (vlib_main_t * vm, { if ((*hm->pop_options[type0]) (ip0, opt0) < 0) { - next0[0] = VXLAN_GPE_INPUT_NEXT_DROP; + *next0 = VXLAN_GPE_INPUT_NEXT_DROP; goto trace00; } } @@ -184,7 +184,7 @@ vxlan_gpe_pop_ioam_v4_one_inline (vlib_main_t * vm, } - next0[0] = + *next0 = (gpe_ioam0->protocol < VXLAN_GPE_PROTOCOL_MAX) ? ngm-> decap_next_node_list[gpe_ioam0->protocol] : VXLAN_GPE_INPUT_NEXT_DROP; @@ -195,7 +195,7 @@ trace00: vxlan_gpe_pop_ioam_v4_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); u32 trace_len = gpe_ioam0->length; - t->fmt_trace.next_index = next0[0]; + t->fmt_trace.next_index = *next0; /* Capture the h-b-h option verbatim */ trace_len = trace_len < -- cgit 1.2.3-korg