diff --git a/pkg/proxy/util/nodeport_addresses.go b/pkg/proxy/util/nodeport_addresses.go index 694c122c5b8..27d186964d0 100644 --- a/pkg/proxy/util/nodeport_addresses.go +++ b/pkg/proxy/util/nodeport_addresses.go @@ -96,10 +96,6 @@ func ContainsIPv4Loopback(cidrStrings []string) bool { // RFC 5735 127.0.0.0/8 - This block is assigned for use as the Internet host loopback address ipv4LoopbackStart := netutils.ParseIPSloppy("127.0.0.0") for _, cidr := range cidrStrings { - if IsZeroCIDR(cidr) { - return true - } - ip, ipnet, err := netutils.ParseCIDRSloppy(cidr) if err != nil { continue diff --git a/pkg/proxy/util/nodeport_addresses_test.go b/pkg/proxy/util/nodeport_addresses_test.go index 3d62c29e0f2..b77f6075902 100644 --- a/pkg/proxy/util/nodeport_addresses_test.go +++ b/pkg/proxy/util/nodeport_addresses_test.go @@ -280,9 +280,9 @@ func TestContainsIPv4Loopback(t *testing.T) { want: true, }, { - name: "all zeros ipv6", // interpret all zeros equal for IPv4 and IPv6 as Golang stdlib + name: "all zeros ipv6", cidrStrings: []string{"224.0.0.0/24", "192.168.0.0/16", "fd00:1:d::/64", "::/0"}, - want: true, + want: false, }, { name: "ipv4 loopback", @@ -318,7 +318,7 @@ func TestContainsIPv4Loopback(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := ContainsIPv4Loopback(tt.cidrStrings); got != tt.want { - t.Errorf("ContainLoopback() = %v, want %v", got, tt.want) + t.Errorf("ContainsIPv4Loopback() = %v, want %v", got, tt.want) } }) }