Alias 0/0 to be 0.0.0.0/0

This commit is contained in:
Star Brilliant
2017-11-30 13:42:24 +08:00
parent 82e9503849
commit 5e6be777c9

View File

@@ -129,13 +129,13 @@ func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
}
ednsClientSubnet := r.FormValue("edns_client_subnet")
if ednsClientSubnet == "0/0" {
ednsClientSubnet = "0.0.0.0/0"
}
ednsClientFamily := uint16(0)
ednsClientAddress := net.IP(nil)
ednsClientNetmask := uint8(255)
if ednsClientSubnet != "" {
if ednsClientSubnet == "0/0" {
ednsClientSubnet = "0.0.0.0/0"
}
slash := strings.IndexByte(ednsClientSubnet, '/')
if slash < 0 {
ednsClientAddress = net.ParseIP(ednsClientSubnet)