wwan: allow completing new GSM connections without an APN (bgo #729665)

In commit 215306f5 [1], NetworkManager was changed to require an APN for GSM
connections; previously, an omitted APN was taken as "use the default APN
for this device".

ModemManager supports this behaviour with an empty APN string; older
NetworkManager versions support this behaviour with no APN in the
settings. Choose the older NM behaviour, for backwards compatibility.

[1] commit 215306f5a1
  Author: Dan Williams <dcbw@redhat.com>
  Date:   Mon Jan 10 23:39:12 2011 -0600

    core: add AddAndActivate D-Bus method

    Given connection details, complete the connection as well as possible
    using the given specific object and device, add it to system
    settings, and activate it all in one method.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=729665
This commit is contained in:
Simon Farnsworth
2014-07-23 14:12:06 -05:00
committed by Dan Williams
parent 0151df2f0a
commit 155cd790f3

View File

@@ -463,8 +463,8 @@ complete_connection (NMModem *_self,
NMSettingGsm *s_gsm; NMSettingGsm *s_gsm;
s_gsm = nm_connection_get_setting_gsm (connection); s_gsm = nm_connection_get_setting_gsm (connection);
if (!s_gsm || !nm_setting_gsm_get_apn (s_gsm)) { if (!s_gsm) {
/* Need an APN at least */ /* Need a GSM setting at least */
g_set_error_literal (error, g_set_error_literal (error,
NM_SETTING_GSM_ERROR, NM_SETTING_GSM_ERROR,
NM_SETTING_GSM_ERROR_MISSING_PROPERTY, NM_SETTING_GSM_ERROR_MISSING_PROPERTY,