fib: fix urpf_itfs vector overflow 58/20558/2
authorBenoît Ganne <bganne@cisco.com>
Tue, 9 Jul 2019 11:50:35 +0000 (13:50 +0200)
committerNeale Ranns <nranns@cisco.com>
Tue, 9 Jul 2019 14:32:19 +0000 (14:32 +0000)
commit3f5ebed6ea3a024b7396afe81f895719a8286681
tree0e6bb672366cb1c659ece8e60d39d9275bde6ec7
parent57783efb822699ee5acc637580ca855fb9b7e4cc
fib: fix urpf_itfs vector overflow

When removing duplicates in urpf_itfs vector we search for the 1st next
different entry in the vector, but the loop test is in the wrong order:
(urpf->furpf_itfs[i] == urpf->furpf_itfs[j]
  && j < vec_len(urpf->furpf_itfs))
We must check for overflow before checking equality.

Type: fix
Fixes: 3ee44040c66cbe47ff292ac7fb0badccbe2afe6d

Change-Id: I63729aff12057d5abce6c24ec24339cd9cd79494
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vnet/fib/fib_urpf_list.c