diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-02-21 13:34:23 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-02-21 17:51:21 +0900 |
commit | 1b88fa78d93b8cfb87f9563c5f80cf65097a220b (patch) | |
tree | 8e406a44b1f7d79862653cbe7a31fb8d32e111fb /table/table_manager.go | |
parent | 82ce8fec0e3836aeedb1e15910181d4c29fbaee6 (diff) |
table: fix handleMacMobility()
needs to find a diffrent ESI with the same mac address.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 7 |
1 files changed, 4 insertions, 3 deletions
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 |