summaryrefslogtreecommitdiffstats
path: root/src/vnet/teib/teib_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/teib/teib_cli.c')
-rw-r--r--src/vnet/teib/teib_cli.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/vnet/teib/teib_cli.c b/src/vnet/teib/teib_cli.c
index faf0d828963..63e3645f14a 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 peer = ip46_address_initializer;
ip46_address_t nh = ip46_address_initializer;
+ ip_address_t peer = IP_ADDRESS_V6_ALL_0S;
u32 sw_if_index, nh_table_id;
clib_error_t *error = NULL;
int rv;
@@ -38,7 +38,7 @@ teib_add (vlib_main_t * vm,
if (unformat (line_input, "%U", unformat_vnet_sw_interface,
vnet_get_main (), &sw_if_index))
;
- else if (unformat (line_input, "peer %U", unformat_ip46_address, &peer))
+ else if (unformat (line_input, "peer %U", unformat_ip_address, &peer))
;
else if (unformat (line_input, "nh %U", unformat_ip46_address, &nh))
;
@@ -58,7 +58,7 @@ teib_add (vlib_main_t * vm,
format_unformat_error, line_input);
goto done;
}
- if (ip46_address_is_zero (&peer))
+ if (ip_address_is_zero (&peer))
{
error = clib_error_return (0, "peer required'",
format_unformat_error, line_input);
@@ -71,7 +71,10 @@ teib_add (vlib_main_t * vm,
goto done;
}
- rv = teib_entry_add (sw_if_index, &peer, nh_table_id, &nh);
+ 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);
if (rv)
{
@@ -99,7 +102,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;
- ip46_address_t peer = ip46_address_initializer;
+ ip_address_t peer = IP_ADDRESS_V6_ALL_0S;
clib_error_t *error = NULL;
u32 sw_if_index;
int rv;
@@ -115,7 +118,7 @@ teib_del (vlib_main_t * vm,
if (unformat (line_input, "%U", unformat_vnet_sw_interface,
vnet_get_main (), &sw_if_index))
;
- else if (unformat (line_input, "peer %U", unformat_ip46_address, &peer))
+ else if (unformat (line_input, "peer %U", unformat_ip_address, &peer))
;
else
{
@@ -130,14 +133,17 @@ teib_del (vlib_main_t * vm,
error = clib_error_return (0, "interface required'",
format_unformat_error, line_input);
}
- if (ip46_address_is_zero (&peer))
+ if (ip_address_is_zero (&peer))
{
error = clib_error_return (0, "peer required'",
format_unformat_error, line_input);
goto done;
}
- rv = teib_entry_del (sw_if_index, &peer);
+ rv = teib_entry_del (sw_if_index,
+ ip_address_family_to_fib_proto (ip_addr_version
+ (&peer)),
+ &ip_addr_46 (&peer));
if (rv)
{