Filter routes to sync from same HA group (#618)

An additional check and filter for routes that are part
 of the same HA group where the peer is a routing peer
This commit is contained in:
Maycon Santos
2022-12-08 15:15:50 +01:00
committed by GitHub
parent eec24fc730
commit 6f610dca89
5 changed files with 56 additions and 17 deletions

View File

@@ -151,7 +151,7 @@ func (m *DefaultManager) UpdateRoutes(updateSerial uint64, newRoutes []*route.Ro
ownNetworkIDs := make(map[string]bool)
for _, newRoute := range newRoutes {
networkID := getHANetworkID(newRoute)
networkID := route.GetHAUniqueID(newRoute)
if newRoute.Peer == m.pubKey {
ownNetworkIDs[networkID] = true
// only linux is supported for now
@@ -164,7 +164,7 @@ func (m *DefaultManager) UpdateRoutes(updateSerial uint64, newRoutes []*route.Ro
}
for _, newRoute := range newRoutes {
networkID := getHANetworkID(newRoute)
networkID := route.GetHAUniqueID(newRoute)
if !ownNetworkIDs[networkID] {
// if prefix is too small, lets assume is a possible default route which is not yet supported
// we skip this route management