(addr netip.Addr, subnet netip.Prefix, subnetFamily int)
| 520 | } |
| 521 | |
| 522 | func validateAddress(addr netip.Addr, subnet netip.Prefix, subnetFamily int) error { |
| 523 | if !addr.IsValid() { |
| 524 | return nil |
| 525 | } |
| 526 | family := 4 |
| 527 | if addr.Is6() { |
| 528 | family = 6 |
| 529 | } |
| 530 | |
| 531 | if family != subnetFamily { |
| 532 | return fmt.Errorf("parent subnet is an IPv%d block", subnetFamily) |
| 533 | } |
| 534 | if !subnet.Contains(addr) { |
| 535 | return fmt.Errorf("parent subnet %s doesn't contain this address", subnet) |
| 536 | } |
| 537 | |
| 538 | return nil |
| 539 | } |
| 540 | |
| 541 | func getIpamConfig(data []networktypes.IPAMConfig) ([]*libnetwork.IpamConf, []*libnetwork.IpamConf, error) { |
| 542 | ipamV4Cfg := []*libnetwork.IpamConf{} |
no test coverage detected
searching dependent graphs…