[dnsdist] rmResponseRule("name") not working

Remi Gacogne remi.gacogne at powerdns.com
Tue Nov 14 09:24:25 UTC 2023

On 13/11/2023 22:59, Holger Hoffstätte via dnsdist wrote:

> I'm running 1.8.2 and have a response rule:
>> showResponseRules()
> #   Name                      Matches Rule               Action
> 0   myRule                    501     All                Lua response 
> script
> Now I try to remove it by name:
>> rmResponseRule("myRule")
> Error: no rule matched
> Removing by index (0) works fine, but I only know the name.
> If I understand the docs and the source code correctly, this should work.
> Suggestion? Haven't started debugging yet, just wanted to make sure I'm
> not doing something wrong.

It's a bug indeed! The code doesn't properly test if the requested rule 
has been found and bails out if the rule is the last one in the list.
I just opened a pull request [1] that fixes it for me. Thanks for 
reporting this issue!

[1]: https://github.com/PowerDNS/pdns/pull/13488

Best regards,
Remi Gacogne
PowerDNS.COM BV - https://www.powerdns.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20231114/67ebba34/attachment.sig>

More information about the dnsdist mailing list