X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Fconfig.c;fp=vnet%2Fvnet%2Fconfig.c;h=2e056c83738ce29c741264f2cdebe0b4cd4b4235;hb=de393bb76d8c221e1145f62070f51a9ca4191f9f;hp=d2bcdf7d01001c70563835a47e4e45cad6ca0e0c;hpb=0f6b7960716d09129bec60fe942a6bed1ef729d5;p=vpp.git 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; }