aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-05-18 15:05:23 +0200
committerDamjan Marion <dmarion@me.com>2021-05-21 16:49:30 +0000
commit92a8d761c412590f5112239be4c511091b2b2d5a (patch)
treed4337456b046d9a841916b9f1657829ca8ac836a /src/vpp
parent84b543d8b1522d70aada38f3db49aade5230fc64 (diff)
nat: add maximum configured sessions to stat segment
Add /nat44-ed/max-cfg-sessions gauge. Reflects the configured value for configured sessions (per thread). Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I618c8aa0daab0981399cfe9273d191fa1990ef60 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/stats/stat_segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vpp/stats/stat_segment.c b/src/vpp/stats/stat_segment.c
index 24ab3e62ff9..1ca9f5bab0d 100644
--- a/src/vpp/stats/stat_segment.c
+++ b/src/vpp/stats/stat_segment.c
@@ -387,6 +387,7 @@ vlib_stats_pop_heap2 (u64 * error_vector, u32 thread_index, void *oldheap,
* Create a new entry and add name to directory hash.
* Returns ~0 if name exists.
* Called from main heap.
+ * The name is either C-string or nul-terminated vector
*/
u32
stat_segment_new_entry (u8 *name, stat_directory_type_t t)
@@ -404,7 +405,7 @@ stat_segment_new_entry (u8 *name, stat_directory_type_t t)
memset (&e, 0, sizeof (e));
e.type = t;
- memcpy (e.name, name, vec_len (name));
+ strcpy_s (e.name, sizeof (e.name), (char *) name);
oldheap = vlib_stats_push_heap (NULL);
vlib_stat_segment_lock ();