GNOME Bugzilla – Bug 723643
Toggle to disable Wi-Fi hotspot is nonfunctional, so user is stuck with hotspot forever
Last modified: 2014-09-04 17:14:52 UTC
* Click the Use as Hotspot button in the Network panel just to see how it works * Click Turn On * It's WEP, scary! Decide you don't want it anymore. Click the toggle button to turn it off. Actual results: The toggle button switches off. Exit the panel and reenter. The hotspot is back. It is impossible to disable and persists across reboots. Expected results: The toggle works. control-center-3.10.2-4.fc20 NetworkManager-0.9.9.0-27.git20131003.fc20
I don't normally set priority on bugs I report myself, but my options are (1) use command line or (2) run insecure wireless network forever, so I hope this gets attention.
If I manually turned off my wi-fi interface with 'ifconfig down' and then create another hotspot in gnome-control-center, control-center will report that I'm running a hotspot without ever enabling the interface.
I see the same behaviour. Right now, the hotspot interface is actually not ON for me even though the GUI always reports it being on. Ubuntu Gnome 14.04 LTS
(In reply to comment #3) > I see the same behaviour. > Right now, the hotspot interface is actually not ON for me even though the GUI > always reports it being on. > Ubuntu Gnome 14.04 LTS Before this, I had tried (unsuccessfully) to use ap-hotspot script. This behaviour after complete removal of the ap-hotspot script. Link to workaround/s would be much appreciated.
Just to clarify the expected behavior here: the network panel should always reflect the correct state of the hotspot and shouldn't crash when toggling it on or off. If it takes some time to set up the hotspot before the panel can know if it was successful or not, then this should be indicated with a spinner immediately to the left of the Turn On button.
Created attachment 285160 [details] [review] network: Show an error when we fail to turn off hotspot And reset the switch as well. I don't know in which circumstance it could happen, but it's all we can do for now.
Comment on attachment 285160 [details] [review] network: Show an error when we fail to turn off hotspot Attachment 285160 [details] pushed as 15a98c3 - network: Show an error when we fail to turn off hotspot
(In reply to comment #5) > Just to clarify the expected behavior here: the network panel should always > reflect the correct state of the hotspot I couldn't reproduce that. The Wi-Fi page should only show once nm_client_add_and_activate_connection() has succeeded. I have added the patch above though, to catch failure to stop the hotspot. The content of your journal relevant to the failure to turn off the hotspot would be appreciated. I've also filed: https://bugzilla.gnome.org/show_bug.cgi?id=735911 about removing the hotspot connection altogether when stopping it, so it can't be re-activated, even by mistake. > and shouldn't crash when toggling it > on or off. I couldn't reproduce that either. If you can, please file a new bug with the backtrace if it happens again. > If it takes some time to set up the hotspot before the panel can > know if it was successful or not, then this should be indicated with a spinner > immediately to the left of the Turn On button. Urgh. I've just now understood how to reproduce the problem... You need to disable the Hotspot before NM had a chance to set it up. Let's focus on the "Can't turn off half-enabled hotspot" problem.
And follow-up on bug 693024 for the "Wrong state" problem.
NEEDINFO from comment 8.
So to be clear, the problem is that g-c-c lies about the hotspot being constantly active (so it appears that it's impossible to turn off) when it actually is not active. It's never failed to ACTUALLY turn off the hotspot when the hotspot is on, but if you leave the panel and reenter it will report that the hotspot is on again even though it's not. At any point during the example below, if you leave the network panel and reenter the hotspot will be reported to be on. Using NetworkManager-0.9.9.0-43.git20131003.fc20 and control-center-3.10.3-2.fc20, I simply plug an external USB wi-fi device into my computer and visit the network panel: it displays a hotspot as if it were activated, which is bad since all I did was plug in the device. iw reveals that g-c-c is lying: I'm not running any hotspot. (Each time I toggle the button in this example, I then use the command 'iw wlp0s20u5 info' to see if the hotspot is actually running or not, trusting that over what g-c-c reports.) Here is the relevant content of my journal at this point. (You can probably skim most of this, and skip down to my comments between extracts from my journal.) Sep 02 16:05:17 lumiose-city kernel: usb 3-5: new high-speed USB device number 4 using xhci_hcd Sep 02 16:05:17 lumiose-city kernel: usb 3-5: New USB device found, idVendor=0bda, idProduct=8187 Sep 02 16:05:17 lumiose-city kernel: usb 3-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Sep 02 16:05:17 lumiose-city kernel: usb 3-5: Product: RTL8187_Wireless Sep 02 16:05:17 lumiose-city kernel: usb 3-5: Manufacturer: Manufacturer_Realtek_RTL8187_ Sep 02 16:05:17 lumiose-city kernel: usb 3-5: SerialNumber: 00C0CA726E39 Sep 02 16:05:17 lumiose-city mtp-probe[10939]: checking bus 3, device 4: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5" Sep 02 16:05:17 lumiose-city mtp-probe[10939]: bus: 3, device: 4 was not an MTP device Sep 02 16:05:18 lumiose-city kernel: ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' Sep 02 16:05:18 lumiose-city kernel: ieee80211 phy0: hwaddr 00:c0:ca:72:6e:39, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2 Sep 02 16:05:18 lumiose-city kernel: rtl8187: Customer ID is 0xFF Sep 02 16:05:18 lumiose-city kernel: rtl8187: wireless switch is on Sep 02 16:05:18 lumiose-city kernel: usbcore: registered new interface driver rtl8187 Sep 02 16:05:18 lumiose-city crda[10957]: setting regulatory domain to US based on timezone (America/Chicago) Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> rfkill0: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5:1.0/ieee80211/phy0/rfkill0) (driver rtl8187) Sep 02 16:05:18 lumiose-city kernel: cfg80211: Calling CRDA for country: US Sep 02 16:05:18 lumiose-city systemd-udevd[10952]: renamed network interface wlan0 to wlp0s20u5 Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): using nl80211 for WiFi device control Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): new 802.11 WiFi device (driver: 'rtl8187' ifindex: 3) Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): exported as /org/freedesktop/NetworkManager/Devices/2 Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): No existing connection detected. Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2] Sep 02 16:05:18 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): bringing up device. Sep 02 16:05:18 lumiose-city kernel: cfg80211: Regulatory domain changed to country: US Sep 02 16:05:18 lumiose-city kernel: cfg80211: DFS Master region: unset Sep 02 16:05:18 lumiose-city kernel: cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Sep 02 16:05:18 lumiose-city kernel: cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A) Sep 02 16:05:18 lumiose-city kernel: cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A) Sep 02 16:05:18 lumiose-city kernel: cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm), (0 s) Sep 02 16:05:18 lumiose-city kernel: cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A) Sep 02 16:05:18 lumiose-city kernel: cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) Sep 02 16:05:19 lumiose-city kernel: IPv6: ADDRCONF(NETDEV_UP): wlp0s20u5: link is not ready Sep 02 16:05:19 lumiose-city dbus-daemon[1093]: dbus[1093]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service' Sep 02 16:05:19 lumiose-city dbus[1093]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service' Sep 02 16:05:19 lumiose-city systemd[1]: Starting WPA Supplicant daemon... Sep 02 16:05:19 lumiose-city dbus-daemon[1093]: dbus[1093]: [system] Successfully activated service 'fi.w1.wpa_supplicant1' Sep 02 16:05:19 lumiose-city dbus[1093]: [system] Successfully activated service 'fi.w1.wpa_supplicant1' Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> wpa_supplicant started Sep 02 16:05:19 lumiose-city systemd[1]: Started WPA Supplicant daemon. Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5) supports 4 scan SSIDs Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): supplicant interface state: starting -> ready Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42] Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): supplicant interface state: ready -> disconnected Sep 02 16:05:19 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5) supports 4 scan SSIDs Sep 02 16:05:20 lumiose-city ModemManager[1085]: <warn> Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-5': not supported by any plugin Sep 02 16:05:20 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): supplicant interface state: disconnected -> inactive Sep 02 16:07:10 lumiose-city gnome-session[1808]: (gnome-control-center:6101): Gtk-CRITICAL **: gtk_widget_grab_focus: assertion 'GTK_IS_WIDGET (widget)' failed Then I spend ten minutes typing this up. Next I return to the network panel toggle the "activated" hotspot from on to off. At the message dialog, I select "stop network and disconnect users." Nothing appears in my journal, so nothing happened when I clicked Off. (Since I was not actually running a hotspot.) Next I click Use as Hotspot again, and select Turn On. iw shows that GNOME has actually started the hotspot. Yay. Now I toggle the hotspot to off again. iw shows that the hotspot is off. g-c-c successfully turns it off. Yay. I turn the hotspot on yet again. iw reveals that nothing happened, and g-c-c lied about turning it on. My journal reveals some bug, possibly in libnm-glib (and also an apparently unrelated firewalld bug?): Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) starting connection 'Hotspot' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: disconnected -> prepare (reason 'none') [30 40 0] Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) scheduled... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) started... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) scheduled... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) complete. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) starting... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: prepare -> config (reason 'none') [40 50 0] Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5/wireless): connection 'Hotspot' has security, and secrets exist. No new secrets needed. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'ssid' value 'Lumiose City' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'mode' value '1' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'frequency' value '2412' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'key_mgmt' value 'NONE' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'wep_key0' value '<omitted>' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'wep_tx_keyidx' value '0' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) complete. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: set interface ap_scan to 2 Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): disconnecting for new activation request. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: config -> disconnected (reason 'none') [50 30 0] Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): deactivating device (reason 'none') [0] Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) starting connection 'Hotspot' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: disconnected -> prepare (reason 'none') [30 40 0] Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) scheduled... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) started... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) scheduled... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 1 of 5 (Device Prepare) complete. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) starting... Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> (wlp0s20u5): device state change: prepare -> config (reason 'none') [40 50 0] Sep 02 16:25:49 lumiose-city firewalld[1065]: 2014-09-02 16:25:49 ERROR: UNKNOWN_INTERFACE: wlp0s20u5 Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5/wireless): connection 'Hotspot' has security, and secrets exist. No new secrets needed. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'ssid' value 'Lumiose City' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'mode' value '1' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'frequency' value '2412' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'key_mgmt' value 'NONE' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'wep_key0' value '<omitted>' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: added 'wep_tx_keyidx' value '0' Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Activation (wlp0s20u5) Stage 2 of 5 (Device Configure) complete. Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <warn> (wlp0s20u5) firewall zone remove failed: (32) UNKNOWN_INTERFACE: wlp0s20u5 Sep 02 16:25:49 lumiose-city NetworkManager[1194]: <info> Config: set interface ap_scan to 2 Sep 02 16:25:49 lumiose-city gnome-session[1808]: ** (gnome-control-center:6101): WARNING **: async_got_type: could not read properties for /org/freedesktop/NetworkManager/ActiveConnection/2: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist Sep 02 16:25:49 lumiose-city gnome-session[1808]: ** (gnome-control-center:6101): WARNING **: async_got_type: could not read properties for /org/freedesktop/NetworkManager/ActiveConnection/2: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist Sep 02 16:25:49 lumiose-city gnome-session[1808]: (gnome-control-center:6101): network-cc-panel-WARNING **: Failed to add new connection: (1) Creating object for path '/org/freedesktop/NetworkManager/ActiveConnection/2' failed in libnm-glib. Sep 02 16:25:49 lumiose-city gnome-session[1808]: (gnome-control-center:6101): Gtk-CRITICAL **: gtk_widget_grab_focus: assertion 'GTK_IS_WIDGET (widget)' failed When I toggle it off, nothing happens. I haven't managed to make it crash today, which is surprising since it quite often crashes when turning off the "active" hotspot. It also likes to crash if you turn on airplane mode at any point, but neither of these are reliably reproducible. I've reported this airplane mode crash as bug #735932, after wresting for 10 minutes with at least three separate ABRT bugs and giving up. (Try using the "report a problem with ABRT" feature from the app menu... it's good fun. I digress.)
(In reply to comment #11) > So to be clear, the problem is that g-c-c lies about the hotspot being > constantly active (so it appears that it's impossible to turn off) when it > actually is not active. Is the NetworkManager connection you're using setup as a shared connection? It would appear as "Shared to other computers" in nm-connection-editor under the IPv4 tab for that connection. I think the implementation of device_is_hotspot() is really weak, and in your case you get a false positive. If the connection is not shared, could you add a little bit of debug to device_is_hotspot() and connection_is_shared() in panels/network/net-device-wifi.c ? Once that's fixed, things should slowly fall into place.
(In reply to comment #12) > Is the NetworkManager connection you're using setup as a shared connection? It > would appear as "Shared to other computers" in nm-connection-editor under the > IPv4 tab for that connection. Yes it is shared, but of course this must be the setting g-c-c created it with (since g-c-c doesn't offer any configuration for the hotspot, I haven't done anything besides click the button to turn it on).
Looks like gnome-shell is doing pretty much the same thing we are to decide if a hotspot is active: https://github.com/GNOME/gnome-shell/blob/c9f6d5e2a1aad305cbdc3a0af67945bbc7c4641f/js/ui/status/network.js#L1328 It looks like the difference is that gnome-shell checks to see if the connection is active. I think g-c-c is not doing that.
Created attachment 285273 [details] [review] network: report hotspot is running only if device is active This patch SEEMS to work.
My patch helps, but doesn't work when turning on the hotspot fails: the switch still flips to on. (I guess your patch only addressed the case where turning off the hotspot fails.)
(In reply to comment #16) > My patch helps, but doesn't work when turning on the hotspot fails: the switch > still flips to on. That's bug 693024, we need to track the connection state. > (I guess your patch only addressed the case where turning > off the hotspot fails.) Yes, it was supposed to show an error when it failed to turn off the hotspot. Which you would hit because it wasn't enabled in the first place.
Review of attachment 285273 [details] [review]: ::: panels/network/net-device-wifi.c @@ +504,2 @@ is_hotspot = device_is_hotspot (device_wifi); + if (is_hotspot && nm_device_get_active_connection (nm_device) != NULL) { I would do that within device_is_hotspot(). It's silly to have "is_hotspot" be true when the device isn't actually a hotspot. @@ +1270,3 @@ /* go straight to the hotspot UI */ is_hotspot = device_is_hotspot (device_wifi); + if (is_hotspot && nm_device_get_active_connection (nm_device) != NULL) { And it would avoid this duplicate code path.
Created attachment 285372 [details] [review] network: report hotspot is running only if device is active
Review of attachment 285372 [details] [review]: Looks good to me.
Attachment 285372 [details] pushed as aa421e0 - network: report hotspot is running only if device is active
Created attachment 285403 [details] [review] network: Fix build Last patch refers to nm_device instead of the actual variable device.
Comment on attachment 285403 [details] [review] network: Fix build Attachment 285403 [details] pushed as 8629632 - network: Fix build