diff options
Diffstat (limited to 'src/vnet/ip/ip4_punt_drop.c')
-rw-r--r-- | src/vnet/ip/ip4_punt_drop.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/vnet/ip/ip4_punt_drop.c b/src/vnet/ip/ip4_punt_drop.c index 5f40e14754a..4e74963f742 100644 --- a/src/vnet/ip/ip4_punt_drop.c +++ b/src/vnet/ip/ip4_punt_drop.c @@ -390,8 +390,8 @@ ip4_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; @@ -429,9 +429,19 @@ ip4_punt_redirect_cmd (vlib_main_t * vm, } if (is_add) - ip4_punt_redirect_add (rx_sw_if_index, tx_sw_if_index, &nh); + { + if (rx_sw_if_index && tx_sw_if_index) + { + ip4_punt_redirect_add (rx_sw_if_index, tx_sw_if_index, &nh); + } + } else - ip4_punt_redirect_del (rx_sw_if_index); + { + if (rx_sw_if_index) + { + ip4_punt_redirect_del (rx_sw_if_index); + } + } done: unformat_free (line_input); |