Well, the first thing I have done is to read the patch. I can at least say
that the patched code runs resolvconf with the correct syntax and that you
have the right idea.

I don't know the wicd code very well, so I can't comment on whether or not
you are in fact calling FlushDNS() or flush_dns_addresses() in all the
right places. If iface.FlushDNS() gets called when iface gets deconfigured
and if FlushDNS() gets called on all configured ifaces when the app quits,
then you have done it right. :)

To cause DNS to be flushed when the process is terminated you will have to
atexit.register(on_exit) where

def on_exit():
    for iface in list_of_active_ifaces:
        iface.FlushDNS()

I see you already use atexit.register in the daemon, so you know what I am
talking about.

Remark: You should run FlushDNS *before* deconfiguring the interface, thus
(I presume) before doing SetAddress('0.0.0.0') or anything like that.

Remark about the _connect() functions: I see you "take down interface"
before you "bring up interface". If you are entirely sure that you are very
shortly going to do "resolvconf -a foo.wicd" (after bringing up the
interface) then you don't have to do "resolvconf -d foo.wicd" first (before
taking it down) and it might be a worthwhile optimization to skip
the "resolvconf -d foo.wicd", keeping in mind that there is a run-parts on
a hook script directory involved. But if it's possible that we don't get so
far as "resolvconf -a foo.wicd" or if it can take a significant amount of
time to get there, then it's safer to keep the initial "resolvconf -d
foo.wicd" that you have included in the patch.
-- 
Thomas

Reply via email to