Просмотр исходного кода

refactor(topology): clarify allowed location IP overlap condition

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Andrei Kvapil 2 месяцев назад
Родитель
Сommit
172d864e5a
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      pkg/mesh/topology.go

+ 2 - 2
pkg/mesh/topology.go

@@ -265,9 +265,9 @@ 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.
+			// where the allowed IP contains the allowed location IP.
 			for _, i := range s.allowedIPs {
-				if intersect(ip, i) && !ip.Contains(i.IP) {
+				if i.Contains(ip.IP) && !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
 				}