Closed Bug 1235509 Opened 9 years ago Closed 9 years ago

Refreshing IPv6 addresses kills all TCP connections

Categories

(Core :: Networking, defect)

43 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: u559402, Assigned: dragana)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 Build ID: 20151210085006 Steps to reproduce: When an IPv6 router advertisement is received, Firefox closes open sockets, causing data loss. This is the case even if the router advertisement doesn't actually change the IPv6 addresses, but only refreshes the lifetimes of existing addresses. On an IPv6-capable network, this happens fairly frequently (once every few minutes or once every few seconds). See similar problem on Chromium: https://code.google.com/p/chromium/issues/detail?id=100690 Actual results: Firefox closes TCP sockets. Expected results: Firefox sockets are closed only if the addresses really changed.
Component: Untriaged → Networking
Product: Firefox → Core
This probably has something to do with network link change events. Asking Daniel. i could take a look too
Flags: needinfo?(daniel)
Attached patch bug_1235509.patch (obsolete) — Splinter Review
Assignee: nobody → dd.mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(daniel)
Attachment #8703524 - Flags: feedback?(daniel)
doesn't this risk of growing a bit too much if we never evict old entries from that hash? Like for a long-running browser on a system that changes IPv6 address very frequently?
(In reply to Daniel Stenberg [:bagder] from comment #4) > doesn't this risk of growing a bit too much if we never evict old entries > from that hash? Like for a long-running browser on a system that changes > IPv6 address very frequently? We also listen to RTM_DELADDR so addresses will be deleted too. If it is only a change to an existing ip address we are not making a new entry.
Oh right. So the hash contains added addresses and removed addresses get removed from the hash again. So it basically stops sending network change requests if RTM_NEWADDR arrives and it actually wasn't a new address but one we already have. Right? Seems fine! Is this really what happens? We subscribe to IP address and route changes on the netlink socket, I don't understand why it signals us without an actual change. But it looks like this was exactly what Chrome did to their code to avoid the similar problem. (https://src.chromium.org/viewvc/chrome/trunk/src/net/base/address_tracker_linux.cc) It smells like this could also be related to which Linux kernel that's used too, potentially even how it has been configured/built.
(In reply to Daniel Stenberg [:bagder] from comment #6) > Oh right. So the hash contains added addresses and removed addresses get > removed from the hash again. So it basically stops sending network change > requests if RTM_NEWADDR arrives and it actually wasn't a new address but one > we already have. Right? Seems fine! > yes. > Is this really what happens? We subscribe to IP address and route changes on > the netlink socket, I don't understand why it signals us without an actual > change. But it looks like this was exactly what Chrome did to their code to > avoid the similar problem. > (https://src.chromium.org/viewvc/chrome/trunk/src/net/base/ > address_tracker_linux.cc) > It changes the lifetime of ipv6v address but we should not care about these changes valid_lft or preferred_lft changes > It smells like this could also be related to which Linux kernel that's used > too, potentially even how it has been configured/built.
Attached patch bug_1235509_v2.patch (obsolete) — Splinter Review
Attachment #8703524 - Attachment is obsolete: true
Attachment #8703524 - Flags: feedback?(daniel)
Attachment #8705124 - Flags: review?(daniel)
As I'm not a peer in the networking code (yet), I'd like to get a formal OK from someone like :mcmanus so that I can review and r+ it properly !
Flags: needinfo?(mcmanus)
(In reply to Daniel Stenberg [:bagder] from comment #9) > As I'm not a peer in the networking code (yet), I'd like to get a formal OK > from someone like :mcmanus so that I can review and r+ it properly ! go ahead
Flags: needinfo?(mcmanus)
Comment on attachment 8705124 [details] [diff] [review] bug_1235509_v2.patch It looks good! What could possibly be added, at least when working for this particular case, is a more dedicated log output for when an identical address is detected (and ignored) as it would more positively prove that we have addressed the problem we suspect is happening.
Attachment #8705124 - Flags: review?(daniel) → review+
as discussed in the necko meeting - we're going to pref off the linux link monitor code for 45 and 44 under only Linux (if allowed, but I tihnk its a good idea) and pursue the fix on the trunk only. That will make 44 work like 42 - essentially reintroducing the long standing problems resuming from sleep that 43 fixed, but fixing this problem that hits you when you aren't doing anything unusual like sleeping or moving. :bagder and ::dd.mozilla are taking responsibility for making that happen.
Depends on: 1237775
Setting network.notify.changed pref to false really fixes this problem on Firefox v43 installed from Ubuntu repos. Thank you!
only logging added
Attachment #8705124 - Attachment is obsolete: true
Attachment #8706373 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: