On 2023-11-14 10:24, Remi Gacogne via dnsdist wrote:
Hi!
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

Ha! I thought there was something off because it's iterating over a copy
of the rules, but I didn't catch it either at first glance.
Thanks for the fix, it now works as expected.

cheers
Holger
_______________________________________________
dnsdist mailing list
dnsdist@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/dnsdist

Reply via email to