Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben 2018-11-28 22:25:28 +00:00
parent db37038897
commit ab67d69d9b
2 changed files with 6 additions and 5 deletions

View File

@ -642,11 +642,13 @@ func (srv *Server) serveDNS(w *response) {
req := new(Msg)
req.setHdr(dh)
if action := srv.MsgAcceptFunc(dh); action != MsgAccept {
if action == MsgIgnore {
return
}
switch srv.MsgAcceptFunc(dh) {
case MsgAccept:
case MsgIgnore:
return
case MsgReject:
req.SetRcodeFormatError(req)
// Are we allowed to delete any OPT records here?
req.Ns, req.Answer, req.Extra = nil, nil, nil

View File

@ -102,7 +102,6 @@ func RunLocalTCPServerWithFinChan(laddr string) (*Server, string, chan error, er
}
server := &Server{Listener: l, ReadTimeout: time.Hour, WriteTimeout: time.Hour}
server.init()
waitLock := sync.Mutex{}
waitLock.Lock()