diff options
Diffstat (limited to 'src/plugins/urpf/urpf_dp.h')
-rw-r--r-- | src/plugins/urpf/urpf_dp.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/plugins/urpf/urpf_dp.h b/src/plugins/urpf/urpf_dp.h index bfe1f659171..816d8b70b90 100644 --- a/src/plugins/urpf/urpf_dp.h +++ b/src/plugins/urpf/urpf_dp.h @@ -128,6 +128,11 @@ urpf_inline (vlib_main_t * vm, h1 += vnet_buffer (b[1])->ip.save_rewrite_length; } + fib_index0 = + urpf_cfgs[af][dir][vnet_buffer (b[0])->sw_if_index[dir]].fib_index; + fib_index1 = + urpf_cfgs[af][dir][vnet_buffer (b[1])->sw_if_index[dir]].fib_index; + if (AF_IP4 == af) { const ip4_header_t *ip0, *ip1; @@ -135,11 +140,6 @@ urpf_inline (vlib_main_t * vm, ip0 = (ip4_header_t *) h0; ip1 = (ip4_header_t *) h1; - fib_index0 = ip4_main.fib_index_by_sw_if_index - [vnet_buffer (b[0])->sw_if_index[dir]]; - fib_index1 = ip4_main.fib_index_by_sw_if_index - [vnet_buffer (b[1])->sw_if_index[dir]]; - ip4_fib_forwarding_lookup_x2 (fib_index0, fib_index1, &ip0->src_address, @@ -155,11 +155,6 @@ urpf_inline (vlib_main_t * vm, { const ip6_header_t *ip0, *ip1; - fib_index0 = ip6_main.fib_index_by_sw_if_index - [vnet_buffer (b[0])->sw_if_index[dir]]; - fib_index1 = ip6_main.fib_index_by_sw_if_index - [vnet_buffer (b[1])->sw_if_index[dir]]; - ip0 = (ip6_header_t *) h0; ip1 = (ip6_header_t *) h1; @@ -255,12 +250,13 @@ urpf_inline (vlib_main_t * vm, if (VLIB_TX == dir) h0 += vnet_buffer (b[0])->ip.save_rewrite_length; + fib_index0 = + urpf_cfgs[af][dir][vnet_buffer (b[0])->sw_if_index[dir]].fib_index; + if (AF_IP4 == af) { const ip4_header_t *ip0; - fib_index0 = ip4_main.fib_index_by_sw_if_index - [vnet_buffer (b[0])->sw_if_index[dir]]; ip0 = (ip4_header_t *) h0; lb_index0 = ip4_fib_forwarding_lookup (fib_index0, @@ -275,8 +271,6 @@ urpf_inline (vlib_main_t * vm, const ip6_header_t *ip0; ip0 = (ip6_header_t *) h0; - fib_index0 = ip6_main.fib_index_by_sw_if_index - [vnet_buffer (b[0])->sw_if_index[dir]]; lb_index0 = ip6_fib_table_fwding_lookup (fib_index0, &ip0->src_address); |