miekg / dns

DNS library in Go
https://miek.nl/2014/august/16/go-dns-package
BSD 3-Clause "New" or "Revised" License
7.99k stars 1.13k forks source link

Add a hook to catch invalid messages #1568

Closed bemasc closed 3 months ago

bemasc commented 4 months ago

Currently there are hooks for reading messages off the wire (DecorateReader), checking if they comply with policy (MsgAcceptFunc), and generating responses (Handler). However, there is no hook that notifies the server when a message is dropped or rejected due to a syntax error. That makes it hard to monitor these packets without repeating the parsing process.

This PR adds a hook for notifications about invalid packets.

miekg commented 3 months ago

excellent idea. Small comment and making the names more consistent