summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_neighbor.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-04-25 05:40:48 -0700
committerOle Trøan <otroan@employees.org>2018-04-27 14:56:15 +0000
commit8e25495ce9bfbe5e62914a45ed8c0767c21d4ee5 (patch)
tree94eeeb2adfb78d161f1784e31b4b703c948a1d50 /src/vnet/ip/ip6_neighbor.c
parentc7b8f203c0740ddd36bced39439aef63ea092d59 (diff)
IPv6 NS/RS; do not vec_validate global structs in the DP
Change-Id: I5cab31639e7819c9ab7e9c9159d931b25161d00b Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6_neighbor.c')
-rw-r--r--src/vnet/ip/ip6_neighbor.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index 34ddd7d2d58..81a57ca38ec 100644
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -1558,13 +1558,15 @@ icmp6_router_solicitation (vlib_main_t * vm,
sizeof (icmp6_neighbor_discovery_header_t));
/* look up the radv_t information for this interface */
- vec_validate_init_empty
- (nm->if_radv_pool_index_by_sw_if_index, sw_if_index0, ~0);
-
- ri = nm->if_radv_pool_index_by_sw_if_index[sw_if_index0];
+ if (vec_len (nm->if_radv_pool_index_by_sw_if_index) >
+ sw_if_index0)
+ {
+ ri =
+ nm->if_radv_pool_index_by_sw_if_index[sw_if_index0];
- if (ri != ~0)
- radv_info = pool_elt_at_index (nm->if_radv_pool, ri);
+ if (ri != ~0)
+ radv_info = pool_elt_at_index (nm->if_radv_pool, ri);
+ }
error0 =
((!radv_info) ?
@@ -1907,13 +1909,15 @@ icmp6_router_advertisement (vlib_main_t * vm,
u32 ri;
/* look up the radv_t information for this interface */
- vec_validate_init_empty
- (nm->if_radv_pool_index_by_sw_if_index, sw_if_index0, ~0);
-
- ri = nm->if_radv_pool_index_by_sw_if_index[sw_if_index0];
+ if (vec_len (nm->if_radv_pool_index_by_sw_if_index) >
+ sw_if_index0)
+ {
+ ri =
+ nm->if_radv_pool_index_by_sw_if_index[sw_if_index0];
- if (ri != ~0)
- radv_info = pool_elt_at_index (nm->if_radv_pool, ri);
+ if (ri != ~0)
+ radv_info = pool_elt_at_index (nm->if_radv_pool, ri);
+ }
error0 =
((!radv_info) ?