Branches: ceder/7.8/override-decode-error ceder/8.0/override-decode-error ceder/8.1/override-decode-error
If there is an error decoding a DNS message, the current code in Protocols.DNS.server prints a backtrace using werror() and responds to the request with a FORMERR response. In some settings, you might want to treat this (especially the error reporting) differently.
The code on the branches I just pushed adds two methods to Protocols.DNS.server:
- report_decode_error() is used to report errors. The default implementation uses the current werror() message, but derived classes may override it.
- handle_decode_error() sends the FORMERR response. Derived classes may override it.
We've been using Pike 7.8 with this change for a long time at Opera. (We don't actually override handle_decode_error(), only report_decode_error().) I just forwardported out change to Pike 8.0 as well, and it seems to work there as well. (I have not tested the Pike 8.1 implementation, but reading the source code I think it should also work.)
Can I push these commits to the 7.8, 8.0 and 8.1 branches?
pike-devel@lists.lysator.liu.se