summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-03-28 02:18:29 -0700
committerChris Luke <chris_luke@comcast.com>2018-03-29 19:26:49 +0000
commitf3a3bad8006afb0b379761dfe4d5d25de07b32cc (patch)
treeed4e09a82e3e8103d94a25bf432eb9930f602119 /src/vnet
parent109139eed67b7f472cf7328a02265528dbe8934e (diff)
ip6: fix ip6-local urpf checking
Use sw_if_index[VLIB_TX] if set as fib index when doing the urpf check. Change-Id: I5ec3e7f7a54c6782704d91e9a5614fd0f7f9e3de Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ip/ip6_forward.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 2c001115262..88b21d59019 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -975,12 +975,15 @@ ip6_urpf_loose_check (ip6_main_t * im, vlib_buffer_t * b, ip6_header_t * i)
{
const load_balance_t *lb0;
index_t lbi;
+ u32 fib_index;
- lbi = ip6_fib_table_fwding_lookup_with_if_index (im,
- vnet_buffer
- (b)->sw_if_index[VLIB_RX],
- &i->src_address);
+ fib_index = vec_elt (im->fib_index_by_sw_if_index,
+ vnet_buffer (b)->sw_if_index[VLIB_RX]);
+ fib_index =
+ (vnet_buffer (b)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+ fib_index : vnet_buffer (b)->sw_if_index[VLIB_TX];
+ lbi = ip6_fib_table_fwding_lookup (im, fib_index, &i->src_address);
lb0 = load_balance_get (lbi);
return (fib_urpf_check_size (lb0->lb_urpf));