correct EDNS responses (#96)

Tests updated as well and all the middleware. And Prometheus renamed to
metrics (directive is still prometheus).
This commit is contained in:
Miek Gieben
2016-04-09 16:17:53 +01:00
parent db3d689a8a
commit ad221f4b2a
19 changed files with 192 additions and 143 deletions

View File

@@ -32,3 +32,14 @@ func Edns0Version(req *dns.Msg) (*dns.Msg, error) {
return m, errors.New("EDNS0 BADVERS")
}
// edns0Size returns a normalized size based on proto.
func edns0Size(proto string, size int) int {
if proto == "tcp" {
return dns.MaxMsgSize
}
if size < dns.MinMsgSize {
return dns.MinMsgSize
}
return size
}