From 240be365ba6e43e03cf3f24dbbed0130ded1144a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 17 Sep 2025 11:24:59 +0200 Subject: [PATCH] rec docs: ComboAddress has no == operator, don't suggest it has Fixes #16128 Plus some general improvements. One day we should make the Lua classes docs for all three products (more) consistent. Signed-off-by: Otto Moerbeek --- .../docs/lua-scripting/comboaddress.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pdns/recursordist/docs/lua-scripting/comboaddress.rst b/pdns/recursordist/docs/lua-scripting/comboaddress.rst index 0b1a4bbd4f..e60ae9526b 100644 --- a/pdns/recursordist/docs/lua-scripting/comboaddress.rst +++ b/pdns/recursordist/docs/lua-scripting/comboaddress.rst @@ -10,16 +10,17 @@ Make a :class:`ComboAddress` with: newCA("::1") -A :class:`ComboAddress` can be compared against a NetmaskGroup with the :meth:`NetMaskGroup:match` function. +A :class:`ComboAddress` object can be compared against a :class:`NetMaskGroup` object with the :meth:`NetMaskGroup:match` function. -To compare the address (so not the port) of two ComboAddresses, use :meth:`:equal `: +To compare the address (so not the port) of two :class:`ComboAddresses` instances, use :meth:`:equal `: .. code-block:: Lua a = newCA("[::1]:56") b = newCA("[::1]:53") - a == b -- false, port mismatch - a:equal(b) -- true + a == b -- false, reference mismatch + a:toString() == b:toString() -- false, port mismatch + a:equal(b) -- true To convert an address to human-friendly representation, use :meth:`:toString ` or :meth:`:toStringWithPort `. To get only the port number, use :meth:`:getPort() `. @@ -34,6 +35,10 @@ To get only the port number, use :meth:`:getPort() `. An object representing an IP address and port tuple. + .. method:: ComboAddress:equal(comboaddress) -> bool + + Compare the address to another :class:`ComboAddress` object. The port numbers are *not* relevant. + .. method:: ComboAddress:getPort() -> int The portnumber. -- 2.47.3