From f126e1c375fb63ba6ae8121dce3ea86bc6cf1809 Mon Sep 17 00:00:00 2001 From: Vengada Date: Mon, 13 Mar 2017 23:43:58 -0700 Subject: Add support for iOAM (sub-TLV) over NSH-MD2. iOAM trace records are carried as MD2 TLV data. Change-Id: Id6fe6c961aa3879df5ae476f13b0e39bcc6c0dfe Signed-off-by: Vengada --- nsh-plugin/nsh/nsh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nsh-plugin/nsh') diff --git a/nsh-plugin/nsh/nsh.c b/nsh-plugin/nsh/nsh.c index 1699126..4102c15 100644 --- a/nsh-plugin/nsh/nsh.c +++ b/nsh-plugin/nsh/nsh.c @@ -583,7 +583,7 @@ nsh_add_del_map_command_fn (vlib_main_t * vm, next_node = NSH_NODE_NEXT_ENCAP_VXLAN4; else if (unformat (line_input, "encap-vxlan6-intf %d", &sw_if_index)) next_node = NSH_NODE_NEXT_ENCAP_VXLAN6; - else if (unformat (line_input, "encap-none")) + else if (unformat (line_input, "encap-none %d", &sw_if_index)) next_node = NSH_NODE_NEXT_DECAP_ETH_INPUT; else return clib_error_return (0, "parse error: '%U'", @@ -602,7 +602,7 @@ nsh_add_del_map_command_fn (vlib_main_t * vm, return clib_error_return (0, "nsh_action required: swap|push|pop."); if (next_node == ~0) - return clib_error_return (0, "must specific action: [encap-gre-intf | encap-vxlan-gpe-intf | encap-lisp-gpe-intf | encap-none]"); + return clib_error_return (0, "must specific action: [encap-gre-intf | encap-vxlan-gpe-intf | encap-lisp-gpe-intf | encap-none ]"); memset (a, 0, sizeof (*a)); @@ -1611,6 +1611,7 @@ nsh_input_map (vlib_main_t * vm, /* Manipulate MD2 */ if(PREDICT_FALSE(hdr0->md_type == 2)) { + vnet_buffer(b0)->sw_if_index[VLIB_RX] = map0->sw_if_index; nsh_md2_decap(b0, hdr0, header_len0, &next0, NSH_NODE_NEXT_DROP); if (PREDICT_FALSE(next0 == NSH_NODE_NEXT_DROP)) { @@ -1713,6 +1714,7 @@ nsh_input_map (vlib_main_t * vm, /* Manipulate MD2 */ if(PREDICT_FALSE(hdr1->md_type == 2)) { + vnet_buffer(b1)->sw_if_index[VLIB_RX] = map1->sw_if_index; nsh_md2_decap(b1, hdr1, header_len1, &next1, NSH_NODE_NEXT_DROP); if (PREDICT_FALSE(next1 == NSH_NODE_NEXT_DROP)) { @@ -1881,6 +1883,7 @@ nsh_input_map (vlib_main_t * vm, /* Manipulate MD2 */ if(PREDICT_FALSE(hdr0->md_type == 2)) { + vnet_buffer(b0)->sw_if_index[VLIB_RX] = map0->sw_if_index; nsh_md2_decap(b0, hdr0, header_len0, &next0, NSH_NODE_NEXT_DROP); if (PREDICT_FALSE(next0 == NSH_NODE_NEXT_DROP)) { -- cgit 1.2.3-korg