HA Network Routes: prevent routing directly-accessible networks through VPN interface (#612)

Prevent routing peer to add routes from the same HA group as client routes
This commit is contained in:
Krzysztof Nazarewski
2022-12-08 13:19:55 +01:00
committed by braginini
parent 94803417cf
commit 5d544ae55e
3 changed files with 70 additions and 11 deletions

View File

@@ -3,12 +3,13 @@ package routemanager
import (
"context"
"fmt"
"net/netip"
"github.com/netbirdio/netbird/client/internal/peer"
"github.com/netbirdio/netbird/client/status"
"github.com/netbirdio/netbird/iface"
"github.com/netbirdio/netbird/route"
log "github.com/sirupsen/logrus"
"net/netip"
)
type routerPeerStatus struct {
@@ -52,7 +53,7 @@ func newClientNetworkWatcher(ctx context.Context, wgInterface *iface.WGIface, st
return client
}
func getClientNetworkID(input *route.Route) string {
func getHANetworkID(input *route.Route) string {
return input.NetID + "-" + input.Network.String()
}