(clientIP netip.Addr, zoneID string, cidrs []*netip.Prefix, zones []string)
| 338 | } |
| 339 | |
| 340 | func matchIPByCidrZones(clientIP netip.Addr, zoneID string, cidrs []*netip.Prefix, zones []string) (bool, bool) { |
| 341 | zoneFilter := true |
| 342 | for i, ipRange := range cidrs { |
| 343 | if ipRange.Contains(clientIP) { |
| 344 | // Check if there are zone filters assigned and if they match. |
| 345 | if zones[i] == "" || zoneID == zones[i] { |
| 346 | return true, false |
| 347 | } |
| 348 | zoneFilter = false |
| 349 | } |
| 350 | } |
| 351 | return false, zoneFilter |
| 352 | } |
| 353 | |
| 354 | // Interface guards |
| 355 | var ( |
no outgoing calls
no test coverage detected