On 23 Sep 2014 18:34, "Thomas Haller" <thaller redhat com> wrote:
>
> On Tue, 2014-09-23 at 11:03 -0500, Dan Williams wrote:
> > On Mon, 2014-09-22 at 17:33 +0200, Thomas Haller wrote:
> > > On Fri, 2014-09-19 at 21:21 -0500, Kevin Baker wrote:
> > > > Hello all,
> > > >
> > > > I was wondering if there was some justification for the priority
> > > > listing in src/nm-device.c: nm_device_get_priority(). Specifically,
> > > > that a MODEM connection is higher in the priority than a WIFI
> > > > connection.
> > > >
> > > > Note that this is not for connection priority support within the same
> > > > device type (like bug 580018 [1]), but across different devices,
> > > > mainly for the default route.
> > > >
> > > > The reason for asking is that our device will automatically activate a
> > > > Wi-Fi connection when it is detected in range, and fall back to a 3G
> > > > Modem if it goes out of range / is unavailable. This works great,
> > > > however since WiFi is given lower priority by NM, the default route
> > > > stays on the 3G connection all the time.
> > > >
> > > > Is this just a historical thing? Having WiFi priority over Modem would
> > > > also match other platforms such as Android. I can submit the patch we
> > > > are using to swap these (super simple) if desired.
> > > >
> > > > Thanks!
> > > > Kevin
> > >
> > >
> > > The priority of MODEM vs. WIFI was changed by commit:
> > > http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=eefda8aa7df28fb419b8ff827cfba0f8177b1485
> > >
> > > before, the priority was based on nm_device_get_device_type(), with
> > > NM_DEVICE_TYPE_WIFI=2, NM_DEVICE_TYPE_MODEM=8.
> > >
> > >
> > > I don't know the reasons for that change.
> > >
> > > nm_device_get_priority() was/is used both for the autoconnect-priority
> > > and route-metric.
> > > Back then, we also accepted a change of behavior and I think a
> > > behavioral change now would be acceptable as well.
> > >
> > > And I tend to agree that WIFI should have higher priority then MODEM.
> >
> > I believe the decision was made to prioritize WWAN over WiFi since WWAN
> > is typically more expensive (and WiFi is usually "free") therefore you
> > are more likely to intentionally connect WWAN and disconnect it when
> > done, but WiFi can mostly autoconnect without $$ surprises. At least
> > that's the current theory.
> >
> > Yeah, this is inflexible. Thomas is also working on removing this
> > restriction as we speak.
> >
> > Dan
>
>
> Oh, I was wrong. This has nothing to do with autoconnect and
> autoconnect-priority (bgo#580018). It's about which device gets the
> default route and which route metric will be assigned by default.
>
> bgo#735512 will add the possibility for the user to overwrite the
> default priorities. Regardless of that, the question still stands,
> whether we want to prefer WWAN over WiFi by default.
No, we don't. When we now have autoconnect working, it makes even less sense, and more like Android and should behave like it does.
If you only want wwan, just disable wifi.
--
Marius