From 4719107d49d41335757de649cfdcc95a64766ed7 Mon Sep 17 00:00:00 2001 From: richtr Date: Mon, 8 Sep 2014 16:06:16 +0200 Subject: [PATCH] Handle multiple mDNS questions as allowed in RFC6762 --- server.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index d426659..4a81329 100644 --- a/server.go +++ b/server.go @@ -131,9 +131,11 @@ func (s *Server) handleQuery(query *dns.Msg, from net.Addr) error { // Handle each question if len(query.Question) > 0 { - if err := s.handleQuestion(query.Question[0], &resp); err != nil { - log.Printf("[ERR] mdns: failed to handle question %v: %v", - query.Question[0], err) + for i, _ := range query.Question { + if err := s.handleQuestion(query.Question[i], &resp); err != nil { + log.Printf("[ERR] mdns: failed to handle question %v: %v", + query.Question[i], err) + } } }