diff options
author | Neale Ranns <nranns@cisco.com> | 2020-09-17 12:56:47 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-09-17 14:46:07 +0000 |
commit | e6b83059af3365ab12bbe93655a7dea6f691dbda (patch) | |
tree | 7b15b70d2d8a24a5c7dc53ad69a3fb7318fb1383 /src/vnet/teib/teib_cli.c | |
parent | 5ef25165b505f761a099e6c3bc06569cfef74f26 (diff) |
teib: Use ip_address_t not ip46_address_t
Type: improvement
Change-Id: Ica75c4e43d6198658a1954640c7ac56ea68bb39a
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/teib/teib_cli.c')
-rw-r--r-- | src/vnet/teib/teib_cli.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/vnet/teib/teib_cli.c b/src/vnet/teib/teib_cli.c index 63e3645f14a..226b41298ab 100644 --- a/src/vnet/teib/teib_cli.c +++ b/src/vnet/teib/teib_cli.c @@ -20,8 +20,8 @@ teib_add (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, *line_input = &_line_input; - ip46_address_t nh = ip46_address_initializer; - ip_address_t peer = IP_ADDRESS_V6_ALL_0S; + ip_address_t peer = ip_address_initializer; + ip_address_t nh = ip_address_initializer; u32 sw_if_index, nh_table_id; clib_error_t *error = NULL; int rv; @@ -40,7 +40,7 @@ teib_add (vlib_main_t * vm, ; else if (unformat (line_input, "peer %U", unformat_ip_address, &peer)) ; - else if (unformat (line_input, "nh %U", unformat_ip46_address, &nh)) + else if (unformat (line_input, "nh %U", unformat_ip_address, &nh)) ; else if (unformat (line_input, "nh-table-id %d", &nh_table_id)) ; @@ -64,17 +64,14 @@ teib_add (vlib_main_t * vm, format_unformat_error, line_input); goto done; } - if (ip46_address_is_zero (&nh)) + if (ip_address_is_zero (&nh)) { error = clib_error_return (0, "next-hop required'", format_unformat_error, line_input); goto done; } - rv = teib_entry_add (sw_if_index, - ip_address_family_to_fib_proto (ip_addr_version - (&peer)), - &ip_addr_46 (&peer), nh_table_id, &nh); + rv = teib_entry_add (sw_if_index, &peer, nh_table_id, &nh); if (rv) { @@ -102,7 +99,7 @@ teib_del (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, *line_input = &_line_input; - ip_address_t peer = IP_ADDRESS_V6_ALL_0S; + ip_address_t peer = ip_address_initializer; clib_error_t *error = NULL; u32 sw_if_index; int rv; @@ -140,10 +137,7 @@ teib_del (vlib_main_t * vm, goto done; } - rv = teib_entry_del (sw_if_index, - ip_address_family_to_fib_proto (ip_addr_version - (&peer)), - &ip_addr_46 (&peer)); + rv = teib_entry_del (sw_if_index, &peer); if (rv) { |