Skip to content

Commit

Permalink
Fix crash on route withdrawal with addpath
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebageek committed May 11, 2020
1 parent 39a4731 commit 1ceee51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routingtable/adjRIBIn/adj_rib_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 1ceee51

Please sign in to comment.