Skip to content

Conversation

@rastislavs
Copy link
Contributor

Fixes panic in updateNeighbor when when timers are being updated:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xaa8bf4]

goroutine 21 [running]:
github.com/osrg/gobgp/v4/pkg/server.(*BgpServer).updateNeighbor(0x40002da008, 0x40002ee008)
	go/src/github.com/gobgp/pkg/server/server.go:3437 +0x644
github.com/osrg/gobgp/v4/pkg/server.(*BgpServer).UpdatePeer.func1()
	go/src/github.com/gobgp/pkg/server/server.go:3465 +0x58
github.com/osrg/gobgp/v4/pkg/server.(*BgpServer).handleMGMTOp(0xc23f912b666d455d?, 0x40002eaf00)
	go/src/github.com/gobgp/pkg/server/server.go:236 +0x94
github.com/osrg/gobgp/v4/pkg/server.(*BgpServer).Serve(0x40002da008)
	§go/src/github.com/gobgp/pkg/server/server.go:381 +0x400

Also adds a unit-test exercising the updateNeighbor code path, capable of catching this (before the fix).

Fixes nil pointer dereference (err in case of no error)
in updateNeighbor when timers are being updated.

Signed-off-by: Rastislav Szabo <[email protected]>
Add a new unit test exercising updateNeighbor code path.

Signed-off-by: Rastislav Szabo <[email protected]>
@fujita
Copy link
Member

fujita commented Nov 21, 2025

Thanks a lot, merged. Embarrassed, it was such a silly mistake.

So you guys use the feature to update peer config?

@fujita fujita closed this Nov 21, 2025
@rastislavs
Copy link
Contributor Author

So you guys use the feature to update peer config?

Yeah we do use peer config update in Cilium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants