]> Cypherpunks repositories - gostls13.git/commitdiff
net: adjust the test for IPv4 loopback address block
authorMikio Hara <mikioh.mikioh@gmail.com>
Tue, 20 Feb 2018 03:57:51 +0000 (12:57 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Tue, 20 Feb 2018 08:27:20 +0000 (08:27 +0000)
We live in the era of virtualization and isolation.
There is no reason to hesitate to use IPv4 loopback address block for
umbrella-type customer accommodating services.

Fixes #23903

Change-Id: I990dd98e2651a993dac1b105c0bc771f8631cb93
Reviewed-on: https://go-review.googlesource.com/95336
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/interface_test.go

index 534137a913311a5a7c4b0d967ee6a2142c14a23e..13b94857971a961c81c2f884da3efc9f82917316 100644 (file)
@@ -202,7 +202,7 @@ func validateInterfaceUnicastAddrs(ifat []Addr) (*routeStats, error) {
                                if 0 >= prefixLen || prefixLen > 8*IPv4len || maxPrefixLen != 8*IPv4len {
                                        return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
                                }
-                               if ifa.IP.IsLoopback() && (prefixLen != 8 && prefixLen != 8*IPv4len) { // see RFC 1122
+                               if ifa.IP.IsLoopback() && prefixLen < 8 { // see RFC 1122
                                        return nil, fmt.Errorf("unexpected prefix length: %d/%d for %#v", prefixLen, maxPrefixLen, ifa)
                                }
                                stats.ipv4++