net/dnscache: parse passed CIDR

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2020-03-09 13:08:10 -04:00
parent 4800926006
commit 5a1ce4adae
2 changed files with 25 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ func (r *Resolver) addIPCache(host string, ip net.IP, d time.Duration) net.IP {
}
func mustCIDR(s string) *net.IPNet {
_, ipNet, err := net.ParseCIDR("100.64.0.0/10")
_, ipNet, err := net.ParseCIDR(s)
if err != nil {
panic(err)
}