[Dnsmasq-discuss] [PATCH] Forgotten servers from file config on dbus servers update
Petr Menšík
pemensik at redhat.com
Fri Jun 17 10:35:28 UTC 2022
It got reported to me on bug:
https://bugzilla.redhat.com/show_bug.cgi?id=2061944
This issue were introduced by commit
553c4c99cca173e9964d0edbd0676ed96c30f62b, which I backported to Fedora.
I believe it is still unfixed even in master branch.
It is usually simple to reproduce it, when dns=dnsmasq is set in NM.
Then when I connect both on ethernet and wifi, it happens always. I am
not sure why it happens only on two interfaces configured, that might be
just coincidence. Or it requires existing dbus configuration to break.
It does not matter, the problem is elsewhere.
When dbus calls add_update_server function, it has first server in
daemon->servers with flags == 0, domain set from dnsmasq configuration
file. When add_update_server is called from dbus update, it marks all
dbus servers. Then when at least two dbus servers were configured, it
will forget servers at the beginning without mark and replace
daemon->servers with serv->next pointer. Which is some server set by
dbus in this case. The first servers get leaked and their redirection
does not work anymore.
That happens because up pointer were not updated in else branch. up
needs to be updated when not marked, just like it is done in
cleanup_servers function. I have moved out the loop closer to it into
separate replace_server function. It makes it easier to compare again
similar loops above it.
Cheers,
Petr
--
Petr Menšík
Software Engineer, RHEL
Red Hat, http://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnsmasq-2.87-reuse-server.patch
Type: text/x-patch
Size: 2581 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20220617/753f7bdb/attachment.bin>
More information about the Dnsmasq-discuss
mailing list