diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2019-04-16 15:13:18 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2019-04-16 15:13:18 +0200 |
commit | e24215b47ad5cd6599973c3a76a375b99ad75d44 (patch) | |
tree | 773af3a27691137635132b5a9953458d36306bc1 /adapter/vppapiclient | |
parent | df1b888a2bfadefadc7dbfce59d34f811ff002ec (diff) |
Fix crash in stats for removed interfaces/nodes
Change-Id: I36b4cd2625c7f0c5846fe402be7b2aeece4707f8
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'adapter/vppapiclient')
-rw-r--r-- | adapter/vppapiclient/stat_client.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/adapter/vppapiclient/stat_client.go b/adapter/vppapiclient/stat_client.go index a2a9826..55705bd 100644 --- a/adapter/vppapiclient/stat_client.go +++ b/adapter/vppapiclient/stat_client.go @@ -285,10 +285,11 @@ func (c *statClient) DumpStats(patterns ...string) (stats []*adapter.StatEntry, var vector []adapter.Name for k := 0; k < length; k++ { s := C.govpp_stat_segment_data_get_name_vector_index(&v, C.int(k)) - if s == nil { - continue + var name adapter.Name + if s != nil { + name = adapter.Name(C.GoString(s)) } - vector = append(vector, adapter.Name(C.GoString(s))) + vector = append(vector, name) } stat.Data = adapter.NameStat(vector) |