Add set EDNS0 with variable substitution (#937)

* Add set EDNS0 with variable substitution

* Change variable from $ to {}. Un-export constants

* Update README

* Change getRuleData() to ruleData(); Change to use string match from regexp
This commit is contained in:
Thong Huynh 2017-08-24 09:34:07 -07:00 committed by Miek Gieben
parent 5e9991556e
commit 3f05f7e6c0
7 changed files with 304 additions and 10 deletions

View file

@ -24,7 +24,7 @@ func newClassRule(fromS, toS string) (Rule, error) {
}
// Rewrite rewrites the the current request.
func (rule *classRule) Rewrite(r *dns.Msg) Result {
func (rule *classRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
if rule.fromClass > 0 && rule.toClass > 0 {
if r.Question[0].Qclass == rule.fromClass {
r.Question[0].Qclass = rule.toClass