File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -132,20 +132,18 @@ func (ip IP) IsLoopback() bool {
132
132
// RFC 1918 (IPv4 addresses) and RFC 4193 (IPv6 addresses).
133
133
func (ip IP ) IsPrivate () bool {
134
134
if ip4 := ip .To4 (); ip4 != nil {
135
- // Following RFC 4193 , Section 3. Local IPv6 Unicast Addresses which says:
135
+ // Following RFC 1918 , Section 3. Private Address Space which says:
136
136
// The Internet Assigned Numbers Authority (IANA) has reserved the
137
- // following three blocks of the IPv4 address space for private internets:
137
+ // following three blocks of the IP address space for private internets:
138
138
// 10.0.0.0 - 10.255.255.255 (10/8 prefix)
139
139
// 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
140
140
// 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
141
141
return ip4 [0 ] == 10 ||
142
142
(ip4 [0 ] == 172 && ip4 [1 ]& 0xf0 == 16 ) ||
143
143
(ip4 [0 ] == 192 && ip4 [1 ] == 168 )
144
144
}
145
- // Following RFC 4193, Section 3. Private Address Space which says:
146
- // The Internet Assigned Numbers Authority (IANA) has reserved the
147
- // following block of the IPv6 address space for local internets:
148
- // FC00:: - FDFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF (FC00::/7 prefix)
145
+ // Following RFC 4193, Section 8. IANA Considerations which says:
146
+ // The IANA has assigned the FC00::/7 prefix to "Unique Local Unicast".
149
147
return len (ip ) == IPv6len && ip [0 ]& 0xfe == 0xfc
150
148
}
151
149
You can’t perform that action at this time.
0 commit comments