aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_punt_drop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip/ip6_punt_drop.c')
-rw-r--r--src/vnet/ip/ip6_punt_drop.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/vnet/ip/ip6_punt_drop.c b/src/vnet/ip/ip6_punt_drop.c
index a46b7d9024f..88527756966 100644
--- a/src/vnet/ip/ip6_punt_drop.c
+++ b/src/vnet/ip/ip6_punt_drop.c
@@ -301,8 +301,8 @@ ip6_punt_redirect_cmd (vlib_main_t * vm,
{
unformat_input_t _line_input, *line_input = &_line_input;
clib_error_t *error = 0;
- u32 rx_sw_if_index;
- u32 tx_sw_if_index;
+ u32 rx_sw_if_index = 0;
+ u32 tx_sw_if_index = 0;
ip46_address_t nh;
vnet_main_t *vnm;
u8 is_add;
@@ -340,9 +340,19 @@ ip6_punt_redirect_cmd (vlib_main_t * vm,
}
if (is_add)
- ip6_punt_redirect_add (rx_sw_if_index, tx_sw_if_index, &nh);
+ {
+ if (rx_sw_if_index && tx_sw_if_index)
+ {
+ ip6_punt_redirect_add (rx_sw_if_index, tx_sw_if_index, &nh);
+ }
+ }
else
- ip6_punt_redirect_del (rx_sw_if_index);
+ {
+ if (rx_sw_if_index)
+ {
+ ip6_punt_redirect_del (rx_sw_if_index);
+ }
+ }
done:
unformat_free (line_input);