Fix NotImp RCode string (#819)
* Fix NOTIMP typo in RcodeToString RFC 6895 lists RCODE 4 as NotImp. * Accept legacy NOTIMPL spelling in StringToRcode
This commit is contained in:
parent
c03bc41f33
commit
03d7306558
2
msg.go
2
msg.go
|
@ -150,7 +150,7 @@ var RcodeToString = map[int]string{
|
|||
RcodeFormatError: "FORMERR",
|
||||
RcodeServerFailure: "SERVFAIL",
|
||||
RcodeNameError: "NXDOMAIN",
|
||||
RcodeNotImplemented: "NOTIMPL",
|
||||
RcodeNotImplemented: "NOTIMP",
|
||||
RcodeRefused: "REFUSED",
|
||||
RcodeYXDomain: "YXDOMAIN", // See RFC 2136
|
||||
RcodeYXRrset: "YXRRSET",
|
||||
|
|
|
@ -12,6 +12,11 @@ var StringToOpcode = reverseInt(OpcodeToString)
|
|||
// StringToRcode is a map of rcodes to strings.
|
||||
var StringToRcode = reverseInt(RcodeToString)
|
||||
|
||||
func init() {
|
||||
// Preserve previous NOTIMP typo, see github.com/miekg/dns/issues/733.
|
||||
StringToRcode["NOTIMPL"] = RcodeNotImplemented
|
||||
}
|
||||
|
||||
// Reverse a map
|
||||
func reverseInt8(m map[uint8]string) map[string]uint8 {
|
||||
n := make(map[string]uint8, len(m))
|
||||
|
|
Loading…
Reference in New Issue