mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-31 01:05:38 +00:00
Fix ECS serialization
This commit is contained in:
@@ -82,7 +82,7 @@ func Marshal(msg *dns.Msg) *Response {
|
||||
if clientAddress == nil {
|
||||
clientAddress = net.IPv4(0, 0, 0, 0)
|
||||
}
|
||||
scopeMask := net.CIDRMask(int(edns0.SourceScope), len(clientAddress))
|
||||
scopeMask := net.CIDRMask(int(edns0.SourceScope), len(clientAddress) * 8)
|
||||
resp.EdnsClientSubnet = clientAddress.Mask(scopeMask).String() + "/" + strconv.Itoa(int(edns0.SourceScope))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user