After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650494 - Major network menu annoyance
Major network menu annoyance
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-05-18 14:49 UTC by Matthias Clasen
Modified: 2012-05-30 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2011-05-18 14:49:13 UTC
Every morning in the office, I put my laptop on the dock, so it has a wired connection. 

NetworkManager goes ahead and tries all the protected ap's anyway, popping up a series of bulky dialogs that I have to click away. 

The big annoyances here are:

- NM just keeps doing that, the only way to stop it is to disable wifi altogether.

- However, the switch to do so in the network menu keeps disappearing whenever NM starts up another connection attempt !

So I have to win this crazy race where I have to click away one of the dialogs, then open the network menu and disable wifi before the switch gets replaced by 'connecting...' again.

This is very annoying.
Comment 1 William Jon McCann 2011-05-18 14:53:35 UTC
1. we should *never* try to connect to unknown wireless networks
2. we should not ever loop over them
3. we should prompt the user when no networks are connected but only when no networks are connected and networks are available
Comment 2 Lapo Calamandrei 2011-05-18 15:01:08 UTC
Also NM should not try to connect to (known) wifi networks if there's wired connection (with a gatewya to the internet) present.
Comment 3 Owen Taylor 2011-05-18 15:36:56 UTC
AFAIK, this has nothing to do with GNOME Shell... connection policy is all done in the NetworkManager core.

(I don't think the real problem here is the lack of the disable-wifi switch)

The problem here isn't unknown connections, right? It's protected connections where you don't want to dig out your RSA key, or connections you've previously tried to connect to (perhaps accidentally)

(It's a long-standing bug that NetworkManager remembers connections that you accidental select and tries to connect to them again later.)
Comment 4 William Jon McCann 2011-05-18 15:43:58 UTC
It seemed to me to be about unknown connections as well since Matthias said "all the protected APs".  Matthias, have you connected to all those before?  I've only connected to one in the office.
Comment 5 Owen Taylor 2011-05-18 15:47:24 UTC
I've never seen NetworkManager try to connect to a unknown connection, though I've frequently cursed at for trying to reconnect to a protected connection that I selected by accident.
Comment 6 William Jon McCann 2011-05-18 15:48:38 UTC
Which to me is still unknown/untrusted.  But ok.
Comment 7 Dan Williams 2011-05-19 14:39:22 UTC
(In reply to comment #2)
> Also NM should not try to connect to (known) wifi networks if there's wired
> connection (with a gatewya to the internet) present.

Wrong, NM has been doing this for years since NM 0.7 with multiple active connection support.  There's no reason  not to do this, except when things fail like mclasen has found.  But in that case, we want to stop NM from asking you for the details again and just fail the connections silently (or with a notification, but certainly not a dialog).
Comment 8 Dan Williams 2011-05-19 14:48:44 UTC
NM itself will never connect to anything it's not told to connect to either by a client or stored config.

But note that network.js has some weird code in it (that I've commented on before) that will automatically connect to stuff even if you've never connected to it before:

        // XXX: what else to do?
        // for now, just pick a random network
        // (this function is called in a corner case anyway, that is, only when
        // the user toggles the switch and has more than one wireless device)
        if (this._networks.length > 0) {
            let connection = this._createAutomaticConnection(this._networks[0]);
            let accessPoints = sortAccessPoints(this._networks[0].accessPoints);
            this._client.add_and_activate_connection(connection, this.device, accessPoints[0].dbus_path, null);
        }

(I don't think the comment about multiple devices is correct there; this code fires even for one device when you hit the on/off switch)

I don't think the network menu should be doing this.  It shouldn't be picking a random access point and telling NM to connect to it just because you clicked the wifi on/off switch to on.  If the switch gets clicked on, then either you have previously connected access points that NM will automatically connect to, or nothing should happen because you haven't connected to anything in this location before.  But the shell shouldn't be telling NM to connect to random APs the user hasn't explicitly clicked on.
Comment 9 Lapo Calamandrei 2011-05-20 13:10:04 UTC
(In reply to comment #7)
> (In reply to comment #2)
> > Also NM should not try to connect to (known) wifi networks if there's wired
> > connection (with a gatewya to the internet) present.
> 
> Wrong, NM has been doing this for years since NM 0.7 with multiple active
> connection support.  There's no reason  not to do this, except when things fail
> like mclasen has found.  But in that case, we want to stop NM from asking you
> for the details again and just fail the connections silently (or with a
> notification, but certainly not a dialog).

In general, why would you connect to a wireless network when there's a wired one?
If it's resuming a previous known state (already connected in the past to the same wired and wireless networks at the same time) ok, but if the system is already connected to a wired connection (to the internet) I don't see a reason to try to connect to the a (even known) wireless one automatically.
Comment 10 Dan Winship 2011-09-30 17:40:32 UTC
(In reply to comment #8)
> NM itself will never connect to anything it's not told to connect to either by
> a client or stored config.
> 
> But note that network.js has some weird code in it (that I've commented on
> before) that will automatically connect to stuff even if you've never connected
> to it before:

ok, reassigning back to gnome-shell
Comment 11 Giovanni Campagna 2011-09-30 18:57:04 UTC
(In reply to comment #8)
> NM itself will never connect to anything it's not told to connect to either by
> a client or stored config.
> 
> But note that network.js has some weird code in it (that I've commented on
> before) that will automatically connect to stuff even if you've never connected
> to it before:
> 
>         // XXX: what else to do?
>         // for now, just pick a random network
>         // (this function is called in a corner case anyway, that is, only when
>         // the user toggles the switch and has more than one wireless device)
>         if (this._networks.length > 0) {
>             let connection =
> this._createAutomaticConnection(this._networks[0]);
>             let accessPoints =
> sortAccessPoints(this._networks[0].accessPoints);
>             this._client.add_and_activate_connection(connection, this.device,
> accessPoints[0].dbus_path, null);
>         }
> 
> (I don't think the comment about multiple devices is correct there; this code
> fires even for one device when you hit the on/off switch)
> 
> I don't think the network menu should be doing this.  It shouldn't be picking a
> random access point and telling NM to connect to it just because you clicked
> the wifi on/off switch to on.  If the switch gets clicked on, then either you
> have previously connected access points that NM will automatically connect to,
> or nothing should happen because you haven't connected to anything in this
> location before.  But the shell shouldn't be telling NM to connect to random
> APs the user hasn't explicitly clicked on.

No the comment is correct: this is the handler for the device specific switch. In fact, each device, if it's showing its title, will get also a switch, that is unrelated to the global one. The global, on change, will frob the wireless-enabled property, while the specific will call activate() on the NMDevice.
I wouldn't replicate that policy, if I had an Activate per device, similar to Disconnect, but I don't have it, and a switch that only works for a half seems very bad.
Comment 12 Allan Day 2012-05-30 14:44:24 UTC
(In reply to comment #11)
...
> No the comment is correct: this is the handler for the device specific switch.
> In fact, each device, if it's showing its title, will get also a switch, that
> is unrelated to the global one. The global, on change, will frob the
> wireless-enabled property, while the specific will call activate() on the
> NMDevice.
> I wouldn't replicate that policy, if I had an Activate per device, similar to
> Disconnect, but I don't have it, and a switch that only works for a half seems
> very bad.

I'm a bit confused by this comment. Giovanni - is GNOME Shell requesting the connection?
Comment 13 Giovanni Campagna 2012-05-30 15:36:09 UTC
Kind of. If you activate the device specific switch (normally hidden), it will try to activate something (normally, the most recently used connection, or just any that is valid for the device if none), and failing that, it will try to create a new connection, as if you clicked on the "Auto ***" item.
Comment 14 Allan Day 2012-05-30 16:01:29 UTC
It sounds like everyone is saying that their components are doing the right thing. Matthias - are you still experiencing the bug?
Comment 15 Matthias Clasen 2012-05-30 16:29:15 UTC
I haven't seen this in a while, so we should perhaps close this bug.