Skip to content
Snippets Groups Projects
Commit 2b3a355b authored by Christoph Petrausch's avatar Christoph Petrausch
Browse files

Return early if route is not present. We do not need to update any clients or select new best paths

parent 392543c6
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,8 @@ func (a *LocRIB) RemovePath(pfx net.Prefix, p *route.Path) bool {
r := a.rt.Get(pfx)
if r != nil {
oldRoute = r.Copy()
} else {
return true
}
a.rt.RemovePath(pfx, p)
......
......@@ -84,3 +84,14 @@ func TestContainsPfxPath(t *testing.T) {
assert.Equal(t, tc.expected, contains, "mismatch in testcase %v", i)
}
}
func TestLocRIB_RemovePathUnknown(t *testing.T) {
rib := New()
assert.True(t, rib.RemovePath(net.NewPfx(1, 32),
&route.Path{
Type: route.StaticPathType,
StaticPath: &route.StaticPath{
NextHop: 2,
},
}))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment