Skip to content

Commit

Permalink
fix wasted control_ping_id caching
Browse files Browse the repository at this point in the history
during a reconnect, when msg table is reset, these fields aren't
and crash the vpp next time.
  • Loading branch information
Georgy Borodin committed Jun 19, 2024
1 parent 5818b80 commit 29451e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 29451e9

Please sign in to comment.