Closed Bug 1139453 Opened 9 years ago Closed 9 years ago

Linux nsNotifyAddr should detect "offline" when no network interface is UP

Categories

(Core :: Networking, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bagder, Assigned: bagder)

References

Details

Attachments

(1 file, 2 obsolete files)

The nsNotifyAddr logic for Firefox on Linux should work similarly to the Windows backend and signal connectivity based on available network interfaces. If there is a network interface available that is UP and isn't lookback, consider it connected.

Outstanding question: should the same logic apply for FxOS ?
Here's a first take to make the Linux version act similar to how we do on Windows.

If there's a network interface UP that isn't a loopback, consider the link up. Otherwise down.
Comment on attachment 8573217 [details] [diff] [review]
0001-bug-1139453-send-NS_NETWORK_LINK_DATA_UP-DOWN-events.patch

Review handed to :valentin with permission from :jduel
Attachment #8573217 - Flags: review?(valentin.gosu)
Comment on attachment 8573217 [details] [diff] [review]
0001-bug-1139453-send-NS_NETWORK_LINK_DATA_UP-DOWN-events.patch

Ah, scratch that for now. This patch doesn't build/work for b2g since bionic doesn't have getifaddrs(). Need to deal with that somehow first.
Attachment #8573217 - Flags: review?(valentin.gosu)
Take a look at NetworkManager.js which handles up/down for b2g.
We could even ignore b2g for the moment and just fix it for Desktop Linux.
Ah yes. I'll add some magic to make it desktop-linux only.
Yeps, here's a version that explicitly doesn't do the checklink on 2bg but does it on Linux.
Attachment #8573217 - Attachment is obsolete: true
Attachment #8577238 - Flags: review?(valentin.gosu)
Comment on attachment 8577238 [details] [diff] [review]
v2-0001-bug-1139453-send-network-UP-DOWN-events-on-deskto.patch

Review of attachment 8577238 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.
r=valentin with the #ifndef change.

::: netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
@@ +108,5 @@
> +{
> +    // b2g instead has NetworkManager.js which handles UP/DOWN
> +}
> +#else
> +void nsNotifyAddrListener::checkLink(void)

The usual pattern I've seen is
void nsNotifyAddrListener::checkLink(void)
{
#ifndef MOZ_WIDGET_GONK
  do stuff
#endif
  return default...
}
 
This way we only have only definition of this method.
Attachment #8577238 - Flags: review?(valentin.gosu) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a80860d9add6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: