Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkg/mesh/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,22 @@ CheckIPs:
}
}
// Check if allowed location IPs intersect with the allowed IPs.
// If the allowed location IP fully contains an allowed IP, that's fine -
// the more specific route will be used. Only warn if it's a partial overlap
// or if the allowed IP contains the allowed location IP.
for _, i := range s.allowedIPs {
if intersect(ip, i) {
if intersect(ip, i) && !ip.Contains(i.IP) {
level.Warn(t.logger).Log("msg", "overlapping allowed location IPnet with allowed IPnets", "IP", ip.String(), "IP2", i.String(), "segment-location", s.location)
continue CheckIPs
}
}
// Check if allowed location IPs intersect with the private IPs of the segment.
// If the allowed location IP fully contains a private IP, that's fine.
for _, i := range s.privateIPs {
if ip.Contains(i) {
level.Warn(t.logger).Log("msg", "overlapping allowed location IPnet with privateIP", "IP", ip.String(), "IP2", i.String(), "segment-location", s.location)
continue CheckIPs
// This is OK - the allowed location IP contains the private IP,
// so the more specific route to the private IP will still work.
level.Debug(t.logger).Log("msg", "allowed location IPnet contains privateIP", "IP", ip.String(), "IP2", i.String(), "segment-location", s.location)
}
}
}
Expand Down