From 597185cc45184ce36e969c7d0e3ad586095607b0 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Tue, 23 Nov 2021 15:27:16 +0100 Subject: [PATCH] policy: update REROUTE doc to reflect real configuration --- modules/policy/README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/policy/README.rst b/modules/policy/README.rst index 1d87b4887..8397cc020 100644 --- a/modules/policy/README.rst +++ b/modules/policy/README.rst @@ -45,7 +45,7 @@ A *filter* selects which queries will be affected by specified Actions_. There a .. function:: domains(action, domain_table) Like :func:`policy.suffix` match, but the queried name must match exactly, not just its suffix. - + .. function:: suffix_common(action, suffix_table[, common_suffix]) :param action: action if the pattern matches query name @@ -139,16 +139,16 @@ Following actions stop the policy matching on the query, i.e. other rules are no Force requestor to use TCP. It sets truncated bit (*TC*) in response to true if the request came through UDP, which will force standard-compliant clients to retry the request over TCP. -.. function:: REROUTE({{subnet,target}, ...}) +.. function:: REROUTE({subnet = target, ...}) - Reroute IP addresses in response matching given subnet to given target, e.g. ``{'192.0.2.0/24', '127.0.0.0'}`` will rewrite '192.0.2.55' to '127.0.0.55', see :ref:`renumber module ` for more information. See :func:`policy.add` and do not forget to specify that this is *postrule*. Quick example: + Reroute IP addresses in response matching given subnet to given target, e.g. ``{['192.0.2.0/24'] = '127.0.0.0'}`` will rewrite '192.0.2.55' to '127.0.0.55', see :ref:`renumber module ` for more information. See :func:`policy.add` and do not forget to specify that this is *postrule*. Quick example: .. code-block:: lua -- this policy is enforced on answers -- therefore we have to use 'postrule' -- (the "true" at the end of policy.add) - policy.add(policy.REROUTE({'192.0.2.0/24', '127.0.0.0'}), true) + policy.add(policy.all(policy.REROUTE({['192.0.2.0/24'] = '127.0.0.0'})), true) .. function:: ANSWER({ type = { rdata=data, [ttl=1] } }, [nodata=false]) -- 2.47.3