|
|
|
@ -19,6 +19,7 @@ import (
|
|
|
|
|
/* |
|
|
|
|
* Contains an entry for each private block: |
|
|
|
|
* 10.0.0.0/8 |
|
|
|
|
* 100.64.0.0/10 |
|
|
|
|
* 172.16.0.0/12 |
|
|
|
|
* 192.168/16 |
|
|
|
|
*/ |
|
|
|
@ -41,7 +42,8 @@ func (s *serverParts) String() string {
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
|
// Add each private block
|
|
|
|
|
privateBlocks = make([]*net.IPNet, 3) |
|
|
|
|
privateBlocks = make([]*net.IPNet, 4) |
|
|
|
|
|
|
|
|
|
_, block, err := net.ParseCIDR("10.0.0.0/8") |
|
|
|
|
if err != nil { |
|
|
|
|
panic(fmt.Sprintf("Bad cidr. Got %v", err)) |
|
|
|
@ -59,6 +61,12 @@ func init() {
|
|
|
|
|
panic(fmt.Sprintf("Bad cidr. Got %v", err)) |
|
|
|
|
} |
|
|
|
|
privateBlocks[2] = block |
|
|
|
|
|
|
|
|
|
_, block, err = net.ParseCIDR("100.64.0.0/10") |
|
|
|
|
if err != nil { |
|
|
|
|
panic(fmt.Sprintf("Bad cidr. Got %v", err)) |
|
|
|
|
} |
|
|
|
|
privateBlocks[3] = block |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// strContains checks if a list contains a string
|
|
|
|
|