resolvconf should not use dns info for interfaces that are down
Bug #262650 reported by
Benjamin Reed
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
resolvconf (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: resolvconf
Description: Ubuntu 8.04.1
Release: 8.04
resolvconf: 1.38ubuntu1
When resolvconf merges the dns information that it has collected to build a new resolv.conf, it should skip information from any interfaces that are down. I'm running into this problem because vpnc doesn't seem to be cleaning up its information when it dies abnormally, so its invalid information says in resolv.conf.
I think the problem is in list-records. It returns a list of interfaces for which there is dns information. I think it should return a list of interfaces for which there is dns information AND that interface is up. The attached patch does this.
To post a comment you must log in.
Benjamin's patch isn't in resolvconf trunk, I applied it locally and tested it with: vpnc + resolvconf + dnsmasq.
The patch now has an ugly workaround to work with dnsmasq also and works with more interfaces.
Although I think it would be better not to have vpnc die in the first place, so its resolvconf hooks fire, as they normally do.
The patch may solve problems when something dies and /etc/resolvconf /run/interfaces /* files are still left (It probably happened to me with dnsmasq and it's lo.dnsmasq file), so maybe a pid should be associated with the interface files?
If the pid doesn't exist anymore, we skip/delete the interface definition.
And note the strange newline echoing in the script - without it, it glues item together, e.g: eth0tun0 instead of eth0 tune0