From b2a79528c5d221f46bdd766ce9c448714f3b62d5 Mon Sep 17 00:00:00 2001 From: Ben Cartwright-Cox Date: Mon, 27 Feb 2023 15:17:53 +0000 Subject: [PATCH] Fix possible crash from ROA PDU Race Minimization logic Should fix the issue at the bottom Tag https://github.com/bgp/stayrtr/issues/92 --- lib/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.go b/lib/server.go index a9a6f08..8858897 100644 --- a/lib/server.go +++ b/lib/server.go @@ -1033,7 +1033,7 @@ func (vap *VAP) GetFlag() uint8 { func (c *Client) SendSDs(sessionId uint16, serialNumber uint32, data []SendableData) { sort.Slice(data, func(i, j int) bool { - if data[i].Type() == "VRP" && data[i].Type() != "VRP" { + if data[i].Type() == "VRP" && data[j].Type() != "VRP" { return false // Always send VRPs first } if data[i].Type() == "VRP" && data[j].Type() == "VRP" {