[Dnsmasq-discuss] [PATCH v2] dbus: allow setting filter-A and filter-AAAA options

Clayton Craft clayton at craftyguy.net
Fri Feb 24 05:40:10 UTC 2023


On Fri, 10 Feb 2023 13:53:05 -0800 Clayton Craft <clayton at craftyguy.net> wrote:
> ---
> Fixes a typo in the SetFilterAAAA DBus-interface description
> 
>  dbus/DBus-interface |  8 ++++++++
>  src/dbus.c          | 14 ++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/dbus/DBus-interface b/dbus/DBus-interface
> index 59b41b1..00b4465 100644
> --- a/dbus/DBus-interface
> +++ b/dbus/DBus-interface
> @@ -44,6 +44,14 @@ SetFilterWin2KOption
>  --------------------
>  Takes boolean, sets or resets the --filterwin2k option.
>  
> +SetFilterA
> +------------------------
> +Takes boolean, sets or resets the --filter-A option.
> +
> +SetFilterAAAA
> +------------------------
> +Takes boolean, sets or resets the --filter-AAAA option.
> +
>  SetBogusPrivOption
>  ------------------
>  Takes boolean, sets or resets the --bogus-priv option.
> diff --git a/src/dbus.c b/src/dbus.c
> index fd5d1ca..be2c506 100644
> --- a/src/dbus.c
> +++ b/src/dbus.c
> @@ -52,6 +52,12 @@ const char* introspection_xml_template =
>  "    <method name=\"SetFilterWin2KOption\">\n"
>  "      <arg name=\"filterwin2k\" direction=\"in\" type=\"b\"/>\n"
>  "    </method>\n"
> +"    <method name=\"SetFilterA\">\n"
> +"      <arg name=\"filter-a\" direction=\"in\" type=\"b\"/>\n"
> +"    </method>\n"
> +"    <method name=\"SetFilterAAAA\">\n"
> +"      <arg name=\"filter-aaaa\" direction=\"in\" type=\"b\"/>\n"
> +"    </method>\n"
>  "    <method name=\"SetLocaliseQueriesOption\">\n"
>  "      <arg name=\"localise-queries\" direction=\"in\" type=\"b\"/>\n"
>  "    </method>\n"
> @@ -817,6 +823,14 @@ DBusHandlerResult message_handler(DBusConnection *connection,
>      {
>        reply = dbus_set_bool(message, OPT_FILTER, "filterwin2k");
>      }
> +  else if (strcmp(method, "SetFilterA") == 0)
> +    {
> +      reply = dbus_set_bool(message, OPT_FILTER_A, "filter-a");
> +    }
> +  else if (strcmp(method, "SetFilterAAAA") == 0)
> +    {
> +      reply = dbus_set_bool(message, OPT_FILTER_AAAA, "filter-aaaa");
> +    }
>    else if (strcmp(method, "SetLocaliseQueriesOption") == 0)
>      {
>        reply = dbus_set_bool(message, OPT_LOCALISE, "localise-queries");
> -- 
> 2.39.1
> 

Any chance this could get merged? Being able to set filters at runtime is very
useful for multi-homed phones and other devices in cases where we need to
restrict DNS response answers based on IP protocol.

Please let me know if I need to make changes so that it is acceptable.

Thanks!
Clayton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20230223/20606aba/attachment.sig>


More information about the Dnsmasq-discuss mailing list