Skip to content

Commit

Permalink
fix wasted control_ping_id caching (#221)
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.

Co-authored-by: Georgy Borodin <[email protected]>
  • Loading branch information
bor1go and Georgy Borodin authored Jun 25, 2024
1 parent 5818b80 commit 2ca162e
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 2ca162e

Please sign in to comment.