diff options
author | 2017-04-29 15:06:42 +0100 | |
---|---|---|
committer | 2017-04-29 07:06:42 -0700 | |
commit | 7d39c2ba51aed96f983abd89ba59518eba524df3 (patch) | |
tree | 37d70edb8389d7b02413a7bd8d62f81d1b9e78e6 /middleware/pkg/response/classify.go | |
parent | 1f63e639e4b99fb4296799aba51841d706042d66 (diff) | |
download | coredns-7d39c2ba51aed96f983abd89ba59518eba524df3.tar.gz coredns-7d39c2ba51aed96f983abd89ba59518eba524df3.tar.zst coredns-7d39c2ba51aed96f983abd89ba59518eba524df3.zip |
middleware/cache: don't cache expired RRSIGs (#641)
Check message for expired sig and don't cache those.
Aside: This hack of caching entire messages is probably something we
should stop doing at some point in the future and do this on a per RRset
basis.
Fixes #367 #635
Diffstat (limited to 'middleware/pkg/response/classify.go')
-rw-r--r-- | middleware/pkg/response/classify.go | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/middleware/pkg/response/classify.go b/middleware/pkg/response/classify.go index e9f17fe00..2e705cb0b 100644 --- a/middleware/pkg/response/classify.go +++ b/middleware/pkg/response/classify.go @@ -1,10 +1,6 @@ package response -import ( - "fmt" - - "github.com/miekg/dns" -) +import "fmt" // Class holds sets of Types type Class int @@ -50,14 +46,8 @@ func ClassFromString(s string) (Class, error) { return All, fmt.Errorf("invalid Class: %s", s) } -// Classify classifies a dns message: it returns its Class. -func Classify(m *dns.Msg) (Class, *dns.OPT) { - t, o := Typify(m) - return classify(t), o -} - -// Does need to be exported? -func classify(t Type) Class { +// Classify classifies the Type t, it returns its Class. +func Classify(t Type) Class { switch t { case NoError, Delegation: return Success |