diff options
Diffstat (limited to 'vnet/vnet/config.c')
-rw-r--r-- | vnet/vnet/config.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vnet/vnet/config.c b/vnet/vnet/config.c index d2bcdf7d010..2e056c83738 100644 --- a/vnet/vnet/config.c +++ b/vnet/vnet/config.c @@ -276,8 +276,15 @@ u32 vnet_config_add_feature (vlib_main_t * vm, new = find_config_with_features (vm, cm, new_features); new->reference_count += 1; - /* User gets pointer to config string first element (which defines the pool index - this config string comes from). */ + /* + * User gets pointer to config string first element + * (which defines the pool index + * this config string comes from). + */ + vec_validate (cm->config_pool_index_by_user_index, + new->config_string_heap_index + 1); + cm->config_pool_index_by_user_index [new->config_string_heap_index + 1] + = new - cm->config_pool; return new->config_string_heap_index + 1; } @@ -327,5 +334,9 @@ u32 vnet_config_del_feature (vlib_main_t * vm, new = find_config_with_features (vm, cm, new_features); new->reference_count += 1; + vec_validate (cm->config_pool_index_by_user_index, + new->config_string_heap_index + 1); + cm->config_pool_index_by_user_index [new->config_string_heap_index + 1] + = new - cm->config_pool; return new->config_string_heap_index + 1; } |