X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Fcli.c;h=c17599afdadc9d5dca9aaf5cbaa253b0bed89fbf;hb=7866c4595b65f54f491ffc4e92b1f8cf94d6f142;hp=c86995ce5cc3ed1228370cffc497a5ae819a5f94;hpb=2df39094d20ae60d2e04316f4ec058f81778cf64;p=vpp.git diff --git a/src/vnet/devices/tap/cli.c b/src/vnet/devices/tap/cli.c index c86995ce5cc..c17599afdad 100644 --- a/src/vnet/devices/tap/cli.c +++ b/src/vnet/devices/tap/cli.c @@ -43,7 +43,6 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, /* Get a line of input. */ if (unformat_user (input, unformat_line_input, line_input)) { - while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "id %u", &args.id)) @@ -62,10 +61,16 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, unformat_ip4_address, &args.host_ip4_addr, &args.host_ip4_prefix_len)) ip_addr_set = 1; + else if (unformat (line_input, "host-ip4-gw %U", + unformat_ip4_address, &args.host_ip4_gw)) + args.host_ip4_gw_set = 1; else if (unformat (line_input, "host-ip6-addr %U/%d", unformat_ip6_address, &args.host_ip6_addr, &args.host_ip6_prefix_len)) ip_addr_set = 1; + else if (unformat (line_input, "host-ip6-gw %U", + unformat_ip6_address, &args.host_ip6_gw)) + args.host_ip6_gw_set = 1; else if (unformat (line_input, "rx-ring-size %d", &args.rx_ring_sz)) ; else if (unformat (line_input, "tx-ring-size %d", &args.tx_ring_sz)) @@ -74,8 +79,11 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, unformat_ethernet_address, args.mac_addr)) args.mac_addr_set = 1; else - return clib_error_return (0, "unknown input `%U'", - format_unformat_error, input); + { + unformat_free (line_input); + return clib_error_return (0, "unknown input `%U'", + format_unformat_error, input); + } } unformat_free (line_input); } @@ -100,7 +108,8 @@ VLIB_CLI_COMMAND (tap_create_command, static) = { .short_help = "create tap {id } [hw-addr ] " "[rx-ring-size ] [tx-ring-size ] [host-ns ] " "[host-bridge ] [host-ip4-addr ] " - "[host-ip6-addr ]", + "[host-ip6-addr ] [host-ip4-gw ] " + "[host-ip6-gw ] [host-if-name ]", .function = tap_create_command_fn, }; /* *INDENT-ON* */