From 4867124319c179d2a573d465a5dff2845176fb99 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Tue, 23 Jun 2015 11:13:40 +0900 Subject: table: add Equal() method to compare PeerInfo this patch fixes the wrong behavior shown below $ gobgp global rib add 10.0.0.0/24 $ gobgp global rib del 10.0.0.0/24 $ gobgp global rib Network Next Hop AS_PATH Age Attrs *> 10.0.0.0/24 0.0.0.0 65000 00:05:48 [{Origin: IGP}] since we used to compare path's source by PeerInfo's pointer, locally originated routes is considered as a different route even if they have same prefix. this patch introduce Equal() method to compare PeerInfo's content and fix this wrong behavior. Signed-off-by: ISHIDA Wataru --- table/message.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'table/message.go') diff --git a/table/message.go b/table/message.go index 5b444ce0..4455e06b 100644 --- a/table/message.go +++ b/table/message.go @@ -215,7 +215,7 @@ func isMergeable(p1 Path, p2 Path) bool { if p1.GetRouteFamily() != bgp.RF_IPv4_UC { return false } - if p1.GetSource() == p2.GetSource() && isSamePathAttrs(p1.getPathAttrs(), p2.getPathAttrs()) { + if p1.GetSource().Equal(p2.GetSource()) && isSamePathAttrs(p1.getPathAttrs(), p2.getPathAttrs()) { return true } return false -- cgit v1.2.3