From 1ceee5169b1d69613480a5b88659722a13ab6bef Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Mon, 11 May 2020 02:33:36 +0200 Subject: [PATCH] Fix crash on route withdrawal with addpath If addpath is enabled rx then adjRIBIn.RemovePath() will access a member of p. As p might be nil (e.g. called by fsm_address_family withdraw()) we need to check for this before accessing it. --- routingtable/adjRIBIn/adj_rib_in.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routingtable/adjRIBIn/adj_rib_in.go b/routingtable/adjRIBIn/adj_rib_in.go index 574711ba..c7868eea 100644 --- a/routingtable/adjRIBIn/adj_rib_in.go +++ b/routingtable/adjRIBIn/adj_rib_in.go @@ -220,7 +220,7 @@ func (a *AdjRIBIn) removePath(pfx *net.Prefix, p *route.Path) bool { oldPaths := r.Paths() for _, path := range oldPaths { if a.addPathRX { - if path.BGPPath.PathIdentifier != p.BGPPath.PathIdentifier { + if p != nil && path.BGPPath.PathIdentifier != p.BGPPath.PathIdentifier { continue } }