Skip to content

Commit

Permalink
Fix bug where sniffer would not stop gracefully upon context cancella…
Browse files Browse the repository at this point in the history
…tion (#248)
  • Loading branch information
orishoshan authored Oct 24, 2024
1 parent d6d71a6 commit a646148
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sniffer/pkg/sniffer/sniffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a646148

Please sign in to comment.