mirror of
https://github.com/coredns/coredns.git
synced 2026-05-25 19:30:23 -04:00
fix: reject unknown trace and dnstap block options (#8120)
This commit is contained in:
@@ -180,6 +180,8 @@ func parseConfig(c *caddy.Controller) ([]*Dnstap, error) {
|
||||
}
|
||||
d.ExtraFormat = c.Val()
|
||||
}
|
||||
default:
|
||||
return nil, c.Errf("unknown property '%s'", c.Val())
|
||||
}
|
||||
}
|
||||
dnstaps = append(dnstaps, &d)
|
||||
|
||||
@@ -59,6 +59,7 @@ func TestConfig(t *testing.T) {
|
||||
{"dnstap dnstap.sock {\nidentity\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}},
|
||||
{"dnstap dnstap.sock {\nversion\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}},
|
||||
{"dnstap dnstap.sock {\nextra\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}},
|
||||
{"dnstap dnstap.sock {\nidentitiy NAME\n}\n", true, []results{{endpoint: "dnstap.sock", full: false, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}},
|
||||
// Limits and parsing for writebuffer (MiB) and queue (x10k)
|
||||
{"dnstap dnstap.sock full 1024 2048", false, []results{{endpoint: "dnstap.sock", full: true, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1024, multipleQueue: 2048}}},
|
||||
{"dnstap dnstap.sock full 1025 1", true, []results{{endpoint: "dnstap.sock", full: true, proto: "unix", identity: []byte(hostname), version: []byte("-"), multipleTcpWriteBuf: 1, multipleQueue: 1}}},
|
||||
|
||||
Reference in New Issue
Block a user