From 1b88fa78d93b8cfb87f9563c5f80cf65097a220b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 21 Feb 2018 13:34:23 +0900 Subject: table: fix handleMacMobility() needs to find a diffrent ESI with the same mac address. Signed-off-by: FUJITA Tomonori --- table/table_manager.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'table') diff --git a/table/table_manager.go b/table/table_manager.go index 498aabad..7341df17 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -259,7 +259,7 @@ func (manager *TableManager) handleMacMobility(path *Path) []*Destination { if !path2.IsLocal() || path2.GetNlri().(*bgp.EVPNNLRI).RouteType != bgp.EVPN_ROUTE_TYPE_MAC_IP_ADVERTISEMENT { continue } - f := func(p *Path) (uint32, net.HardwareAddr, int) { + f := func(p *Path) (bgp.EthernetSegmentIdentifier, net.HardwareAddr, int) { nlri := p.GetNlri().(*bgp.EVPNNLRI) d := nlri.RouteTypeData.(*bgp.EVPNMacIPAdvertisementRoute) ecs := p.GetExtCommunities() @@ -270,13 +270,14 @@ func (manager *TableManager) handleMacMobility(path *Path) []*Destination { break } } - return d.ETag, d.MacAddress, seq + return d.ESI, d.MacAddress, seq } e1, m1, s1 := f(path) e2, m2, s2 := f(path2) - if e1 == e2 && bytes.Equal(m1, m2) && s1 > s2 { + if bytes.Equal(m1, m2) && !bytes.Equal(e1.Value, e2.Value) && s1 > s2 { path2.IsWithdraw = true dsts = append(dsts, manager.Tables[bgp.RF_EVPN].insert(path2)) + break } } return dsts -- cgit v1.2.3