Add missing test file and fix notify

We should not check the port of the request, we *should* actually
normalize it to port 53 - as that will probably be the address of
the server. Still need to double check if this will work if the
axfr should actually be done from a different port. That will come
later, this is good enough for now.
This commit is contained in:
Miek Gieben 2016-04-07 08:03:57 +01:00
parent e4c72719bf
commit 09207867e4
3 changed files with 56 additions and 3 deletions

View file

@ -138,11 +138,11 @@ func TestIsNotify(t *testing.T) {
// need to set opcode
state.Req.Opcode = dns.OpcodeNotify
z.TransferFrom = []string{"10.240.0.1:40212"} // IP from from testing/responseWriter
z.TransferFrom = []string{"10.240.0.1:53"} // IP from from testing/responseWriter
if !z.isNotify(state) {
t.Fatal("should have been valid notify")
}
z.TransferFrom = []string{"10.240.0.2:40212"}
z.TransferFrom = []string{"10.240.0.2:53"}
if z.isNotify(state) {
t.Fatal("should have been invalid notify")
}