• Beniamino Galvani's avatar
    dns: fix updating resolv.conf after dnsmasq process dies · f2a20127
    Beniamino Galvani authored
    When the dnsmasq process dies, two events are generated:
    (1) a NM_DNS_PLUGIN_FAILED signal in nm-dns-dnsmasq.c:name_owner_changed()
    (2) a NM_DNS_PLUGIN_CHILD_QUIT signal in nm-dns-plugin.c:from watch_cb()
    Event (1) is handled by updating resolv.conf with upstream servers,
    (2) by restarting the child process.
    The order in which the two signals are received is not deterministic,
    so when (1) comes after (2) the manager leaves upstream servers in
    resolv.conf even if a dnsmasq instance is running.
    When dnsmasq disappears from D-Bus and we know that the process is not
    running, we should not emit a FAILED signal because the disappearing
    is caused by the process termination, and that event is already
    handled by the manager.
nm-dns-dnsmasq.c 13.9 KB