mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
[management] added exception on not appending route firewall rules if we have all wildcard (#4801)
This commit is contained in:
@@ -22,10 +22,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
allPeers = "0.0.0.0"
|
allPeers = "0.0.0.0"
|
||||||
fw = "fw:"
|
allWildcard = "0.0.0.0/0"
|
||||||
rfw = "route-fw:"
|
v6AllWildcard = "::/0"
|
||||||
nr = "network-resource-"
|
fw = "fw:"
|
||||||
|
rfw = "route-fw:"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetworkMapCache struct {
|
type NetworkMapCache struct {
|
||||||
@@ -1640,6 +1641,10 @@ func (b *NetworkMapBuilder) updateRouteFirewallRules(routesView *PeerRoutesView,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if string(rule.RouteID) == update.RuleID {
|
if string(rule.RouteID) == update.RuleID {
|
||||||
|
if hasWildcard := slices.Contains(rule.SourceRanges, allWildcard) || slices.Contains(rule.SourceRanges, v6AllWildcard); hasWildcard {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
sourceIP := update.AddSourceIP
|
sourceIP := update.AddSourceIP
|
||||||
|
|
||||||
if strings.Contains(sourceIP, ":") {
|
if strings.Contains(sourceIP, ":") {
|
||||||
|
|||||||
Reference in New Issue
Block a user