When hotspot is enabled, both arale & krillin create a new WiFi device
called "ap0".  Krillin seems to do the right thing when the hotspot is
activated ( ie. it disconnects the current connection on wlan0 ).  Arale
on the other hand doesn't.

When hotspot is deactivated, the "ap0" device is removed from the
system.

The semi-bad news is that when hotspot is enabled "wlan0" is removed and
then re-added as a new device in NM.  Likewise when hotspot is disabled,
this device is removed and re-added again as well.

So if you start out and "wlan0" is device 6 ( eg.
/org/freedesktop/NetworkManager/Devices/6 ), and you enable hotspot,
it'll get removed, and then re-added as the next available index.  so if
7 was "/ril_0" and was the last device present, when hotspot is enabled,
you'd end up with:

/org/freedesktop/NetworkManager/Devices/0
/org/freedesktop/NetworkManager/Devices/1
/org/freedesktop/NetworkManager/Devices/2
/org/freedesktop/NetworkManager/Devices/3
/org/freedesktop/NetworkManager/Devices/4
/org/freedesktop/NetworkManager/Devices/5
/org/freedesktop/NetworkManager/Devices/7
/org/freedesktop/NetworkManager/Devices/8 ( "wlan0" )
/org/freedesktop/NetworkManager/Devices/9 ( "ap0" )

( Note, the ordering of "wlan0" and "ap0" might be reversed ).

So...  I think our idea of just setting the "Autoconnect" flag of the
WiFi device when enabling hotspot needs to modified slightly.  You need
to be watch the device list and turn off "Autoconnect" for "wlan0" when
it gets re-added.  I don't think you'll need to do handle the disable
hotspot case, as devices are always added with "Autoconnect=true".

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1478009

Title:
  creating a hotspot should disconnect from the current AP & prevent NM
  from auto-connecting to another known AP

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1478009/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to