From 2ca162e7100271bf09a7bdf46f541e93bf8516ea Mon Sep 17 00:00:00 2001 From: bor1go Date: Tue, 25 Jun 2024 19:25:39 +0200 Subject: [PATCH] fix wasted control_ping_id caching (#221) during a reconnect, when msg table is reset, these fields aren't and crash the vpp next time. Co-authored-by: Georgy Borodin --- core/connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/connection.go b/core/connection.go index f04efd05..f9ffe2d5 100644 --- a/core/connection.go +++ b/core/connection.go @@ -548,10 +548,10 @@ func (c *Connection) retrieveMessageIDs() (err error) { n++ nn++ - if c.pingReqID == 0 && msg.GetMessageName() == c.msgControlPing.GetMessageName() { + if msg.GetMessageName() == c.msgControlPing.GetMessageName() { c.pingReqID = msgID c.msgControlPing = reflect.New(reflect.TypeOf(msg).Elem()).Interface().(api.Message) - } else if c.pingReplyID == 0 && msg.GetMessageName() == c.msgControlPingReply.GetMessageName() { + } else if msg.GetMessageName() == c.msgControlPingReply.GetMessageName() { c.pingReplyID = msgID c.msgControlPingReply = reflect.New(reflect.TypeOf(msg).Elem()).Interface().(api.Message) }