aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-03-07 16:18:55 -0500
committerFlorin Coras <florin.coras@gmail.com>2019-03-07 22:41:39 +0000
commit035ea679d54700aee9fb86a8de436330bc8e3bc2 (patch)
tree306fced4cd205856d5f88af4f0e2e6c3f351ced2 /src/vnet
parenteaea421e1fefedc47325f970475c5d48c899433c (diff)
parse ethernet header in ct6_in2out
fix a debug CLI scripting bug: cp_ip6_address_add_del_command_function ate any subsequent commands, yielding indigestion. Change-Id: Iaca7bed5687759da36ae91dc658e758549b71796 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/dhcp/dhcp6_pd_client_cp.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/vnet/dhcp/dhcp6_pd_client_cp.c b/src/vnet/dhcp/dhcp6_pd_client_cp.c
index eb18ed2889a..a157b16d491 100644
--- a/src/vnet/dhcp/dhcp6_pd_client_cp.c
+++ b/src/vnet/dhcp/dhcp6_pd_client_cp.c
@@ -966,26 +966,33 @@ cp_ip6_address_add_del_command_function (vlib_main_t * vm,
u32 prefix_length;
u8 address_set = 0;
u8 add = 1;
+ unformat_input_t _line_input, *line_input = &_line_input;
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat
- (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index));
- else if (unformat (input, "prefix group %s", &prefix_group));
+ (line_input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index));
+ else if (unformat (line_input, "prefix group %s", &prefix_group));
else
- if (unformat
- (input, "%U/%d", unformat_ip6_address, &address, &prefix_length))
+ if (unformat (line_input, "%U/%d", unformat_ip6_address,
+ &address, &prefix_length))
address_set = 1;
- else if (unformat (input, "del"))
+ else if (unformat (line_input, "del"))
add = 0;
else
{
error = clib_error_return (0, "unexpected input `%U'",
- format_unformat_error, input);
+ format_unformat_error, line_input);
+ unformat_free (line_input);
goto done;
}
}
+ unformat_free (line_input);
+
if (sw_if_index == ~0)
error = clib_error_return (0, "Missing sw_if_index");
else if (address_set == 0)