Closed
Bug 312061
Opened 19 years ago
Closed 19 years ago
Call res_ninit when restarting the DNS service [was: Firefox keeps a list of dns servers after connection goes down]
Categories
(Core :: Networking, defect, P5)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: sgenchev, Assigned: darin.moz)
Details
Attachments
(1 file)
1.45 KB,
patch
|
Biesinger
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Ubuntu package 1.0.7)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Ubuntu package 1.0.7)
If I bring up another connection that adds entries to my /etc/resolv.conf while
Firefox running, Firefox will pick up new DNS server(s) and will start using
them to do a name resolution. When connection goes down though, Firefox will not
stop using now invalid DNS entries and would try to resolve everything using
them. Only after DNS request times out Firefox starts using other DNS servers.
This will happen with any DHCP-enabled connection. At least in my case it
happens when I bring up and then down VPN connection or wired connection while
wireless connection is running.
Restarting firefox fixes the problem.
Reproducible: Always
Steps to Reproduce:
1. Establish a network connection, bring up Firefox
2. Bring up another connection
3. Browse to a new host to make Firefox resolve new entry
4. Bring connection down
5. Fire up your favorite sniffer to observer port 53 traffic
Actual Results:
Firefox sends DNS queries to a non-valid-any-more DNS server(s)
Expected Results:
Firefox should stop trying to use DNS server that is no longer in /etc/resolv.conf
Updated•19 years ago
|
Assignee: nobody → darin
Component: General → Networking
Product: Firefox → Core
QA Contact: general → benc
Version: unspecified → 1.7 Branch
![]() |
||
Comment 1•19 years ago
|
||
Is this a problem in Gecko 1.8 or current trunk? Gecko 1.7 is ancient...
Assignee | ||
Comment 2•19 years ago
|
||
This is a bug with GLIBC. Please file it against them. We try to workaround the buggy behavior of the GLIBC by calling res_ninit whenever we detect a lookup failure, but this doesn't help in the case you describe. Unless we were to call res_ninit (which causes GLIBC to re-read /etc/resolv.conf) before every lookup, I'm not sure how we would cope with this problem.
This issue is not Mozilla 1.7 specific. It should still happen w/ trunk builds.
Confirming bug, but this is probably INVALID since there's not much we can do but hope that GLIBC will one day do the right thing.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 1.7 Branch → Trunk
Comment 3•19 years ago
|
||
that's not quite true. once we have the autodetect on/offline code checked in, we can call res_ninit whenever an offline->online change is detected.
Comment 4•19 years ago
|
||
(that can be done irrespective of manageOfflineStatus)
Assignee | ||
Comment 5•19 years ago
|
||
> that's not quite true. once we have the autodetect on/offline code checked in,
> we can call res_ninit whenever an offline->online change is detected.
Yes, good idea. We already shutdown the DNS service when going offline, and we re-initialize it when we go online. We should make DNS service initialization call res_ninit.
Assignee | ||
Comment 6•19 years ago
|
||
OK, morphing the bug...
Severity: normal → minor
Status: NEW → ASSIGNED
Priority: -- → P5
Summary: Firefox keeps a list of dns servers after connection goes down → Call res_ninit when restarting the DNS service [was: Firefox keeps a list of dns servers after connection goes down]
Target Milestone: --- → mozilla1.9alpha
Assignee | ||
Comment 7•19 years ago
|
||
This seems to do the trick. I don't want to call res_ninit during startup, so I've made this code call res_ninit during the initialization of subsequent "DNS services." Actually, the code change is in nsHostResolver.cpp, but there is a 1-1 relationship between nsDNSService and nsHostResolver.
Attachment #219085 -
Flags: superreview?(bzbarsky)
Attachment #219085 -
Flags: review?(cbiesinger)
![]() |
||
Updated•19 years ago
|
Attachment #219085 -
Flags: superreview?(bzbarsky) → superreview+
Updated•19 years ago
|
Attachment #219085 -
Flags: review?(cbiesinger) → review+
Comment 8•19 years ago
|
||
should the DNS service also observe "network:link-status-changed" and call res_ninit whenever the link status changes?
Assignee | ||
Comment 9•19 years ago
|
||
(In reply to comment #8)
> should the DNS service also observe "network:link-status-changed" and call
> res_ninit whenever the link status changes?
No need. The IO service will shutdown and initialize the DNS service in response to that event.
Comment 10•19 years ago
|
||
only if manageOfflineState is true, right?
Assignee | ||
Comment 11•19 years ago
|
||
> only if manageOfflineState is true, right?
Yup, but that should be the default mode of operation.
Comment 12•19 years ago
|
||
(In reply to comment #11)
> > only if manageOfflineState is true, right?
>
> Yup, but that should be the default mode of operation.
Yes, but if that is set to false and something else manages it, that has no way to trigger a res_ninit call, right? (Other than calling setOffline/setOnline...)
Assignee | ||
Comment 13•19 years ago
|
||
> Yes, but if that is set to false and something else manages it, that has no way
> to trigger a res_ninit call, right? (Other than calling
> setOffline/setOnline...)
Right. I think that's reasonable. Anyways, the idea here is really just to re-initialize GLIBC when the nsDNSService is re-initialized. I think that makes sense independent of online/offline toggling.
Assignee | ||
Comment 14•19 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•