diff --git a/src/sniffer/pkg/sniffer/sniffer.go b/src/sniffer/pkg/sniffer/sniffer.go index c5201c22..2db571be 100644 --- a/src/sniffer/pkg/sniffer/sniffer.go +++ b/src/sniffer/pkg/sniffer/sniffer.go @@ -123,6 +123,8 @@ func (s *Sniffer) RunForever(ctx context.Context) error { for { select { + case <-ctx.Done(): + return ctx.Err() case packet := <-dnsPacketsChan: s.dnsSniffer.HandlePacket(packet) case packet := <-tcpPacketsChan: