Merge ~awe/network-manager/+git/ubuntu:touch-vivid2 into network-manager:touch-vivid

Proposed by Tony Espy
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 418ce9b8e301bd50592edade23d7ff062cdb4412
Merged at revision: 832d695d64c3d9fe37fd410e80da0723dc43b0e9
Proposed branch: ~awe/network-manager/+git/ubuntu:touch-vivid2
Merge into: network-manager:touch-vivid
Diff against target: 1538 lines (+832/-167)
24 files modified
debian/changelog (+22/-0)
debian/control (+19/-1)
debian/default-wifi-powersave-on.conf (+2/-0)
debian/indicator-network.pkla (+6/-0)
debian/libnm-dev.install (+1/-1)
debian/network-manager.install (+1/-1)
debian/patches/Add-modem-reconnect-delay-to-policy.patch (+115/-0)
debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch (+1/-1)
debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch (+32/-0)
debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch (+38/-0)
debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch (+37/-0)
debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch (+1/-0)
debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch (+32/-0)
debian/patches/Ignore-p2p-wifi-devices-from-android.patch (+34/-0)
debian/patches/Ignore-rild-modem-devices.patch (+27/-0)
debian/patches/Modify-NMDeviceModem-s-available-logic.patch (+4/-4)
debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch (+2/-0)
debian/patches/Track-killswitch-change-signals-from-urfkill.patch (+4/-4)
debian/patches/Update-dnsmasq-parameters.patch (+1/-1)
debian/patches/series (+8/-3)
debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch (+74/-89)
debian/patches/wwan-fix-ofono-connection-problems.patch (+343/-0)
debian/rules (+28/-11)
dev/null (+0/-51)
Reviewer Review Type Date Requested Status
Simon Fels Approve
Review via email: mp+296476@code.launchpad.net

Description of the change

This merge proposal is a backport of the stable 1.2.2 version of NetworkManager from yakkety to Touch, intended for the Touch overlay PPA.

Changes include ( besides switching to git ):

 - Dropping default WiFi powersave patch and installing a config file to do the same
 - Syncing the Touch NMManager device patches
 - Syncing the Touch WWAN patches
 - Adding a few Touch wpa_supplicant & platform patches
 - Restoring bug headers in some of the patches
 - Disabling ppp and gir in the build, due to build errors on vivid. This should have no impact on our images, and will be fixed when we move to xenial.
 - Adding a final patch to deal with ofono connection edge cases, and a mobile-data re-connect hang.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 893a649..813c545 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
1network-manager (1.2.2-0ubuntu1~vivid1) UNRELEASED; urgency=medium
2
3 * Backported to vivid for Ubuntu Touch:
4 - Added d/indicator-network.pkla: policy kit config
5 - Modified d/rules: disable bluez, gir*, ppp, systemd-journal,
6 and install indicator-network polkit config.
7 - Modified d/control: adjusted ppp-dev version, and restored
8 -dbg package
9 - Modified install files for temporary gir & ppp changes
10 - Re-sync d/p/Ignore* nm-manager device patches from Touch
11 - Re-synced d/p/wwan-add-support* patch from Touch
12 - Re-stored patches from Touch:
13 - Add-modem-reconnect-delay* (LP: #1461593)
14 - indicator-network DBus 'sudo' policy
15 - wpa_suppl scan fixes
16 - OpenVPN EEXISTS bug (LP: #1579222)
17 - Removed d/p/Set-the-default-powersave*.patch, and instead install
18 a config file that accomplishes the same (LP: #1557026).
19 - Add d/p/wwan-fix-ofono-connection-problems (LP: #1565717, #1579098).
20
21 -- Tony Espy <espy@canonical.com> Tue, 24 May 2016 15:30:42 -0400
22
1network-manager (1.2.2-0ubuntu1) yakkety; urgency=medium23network-manager (1.2.2-0ubuntu1) yakkety; urgency=medium
224
3 * Rebase to upstream stable point release. (LP: #1574347)25 * Rebase to upstream stable point release. (LP: #1574347)
diff --git a/debian/control b/debian/control
index 354dfd7..e8429c0 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9),
16 libnl-3-dev (>= 3.2.8),16 libnl-3-dev (>= 3.2.8),
17 libnl-route-3-dev (>= 3.2.8),17 libnl-route-3-dev (>= 3.2.8),
18 libnl-genl-3-dev (>= 3.2.8),18 libnl-genl-3-dev (>= 3.2.8),
19 ppp-dev (>= 2.4.7-1+1),19 ppp-dev (>= 2.4.6),
20 libpolkit-gobject-1-dev,20 libpolkit-gobject-1-dev,
21 libpolkit-agent-1-dev (>= 0.97),21 libpolkit-agent-1-dev (>= 0.97),
22 libgnutls-dev,22 libgnutls-dev,
@@ -248,6 +248,24 @@ Description: GObject-based client library for NetworkManager (development files)
248 .248 .
249 This package contains header and development files.249 This package contains header and development files.
250250
251Package: network-manager-dbg
252Architecture: linux-any
253Section: debug
254Priority: extra
255Depends: ${misc:Depends},
256 network-manager (= ${binary:Version}),
257 libnm-util2 (= ${binary:Version}),
258 libnm-glib4 (= ${binary:Version}),
259 libnm-glib-vpn1 (= ${binary:Version})
260Description: network management framework (debugging symbols)
261 NetworkManager is a system network service that manages your network devices
262 and connections, attempting to keep active network connectivity when
263 available. It manages ethernet, WiFi, mobile broadband (WWAN), and PPPoE
264 devices, and provides VPN integration with a variety of different VPN
265 services.
266 .
267 This package contains detached debugging symbols.
268
251Package: gir1.2-networkmanager-1.0269Package: gir1.2-networkmanager-1.0
252Section: introspection270Section: introspection
253Architecture: linux-any271Architecture: linux-any
diff --git a/debian/default-wifi-powersave-on.conf b/debian/default-wifi-powersave-on.conf
254new file mode 100644272new file mode 100644
index 0000000..0580544
--- /dev/null
+++ b/debian/default-wifi-powersave-on.conf
@@ -0,0 +1,2 @@
1[connection]
2wifi.powersave = 3
0\ No newline at end of file3\ No newline at end of file
diff --git a/debian/indicator-network.pkla b/debian/indicator-network.pkla
1new file mode 1006444new file mode 100644
index 0000000..4e64cae
--- /dev/null
+++ b/debian/indicator-network.pkla
@@ -0,0 +1,6 @@
1[indicator-network-service]
2Identity=unix-group:sudo
3Action=org.freedesktop.NetworkManager.*
4ResultAny=yes
5ResultInactive=no
6ResultActive=yes
diff --git a/debian/libnm-dev.install b/debian/libnm-dev.install
index 4dddc86..58dd896 100644
--- a/debian/libnm-dev.install
+++ b/debian/libnm-dev.install
@@ -2,4 +2,4 @@ usr/lib/*/pkgconfig/libnm.pc
2usr/lib/*/libnm.so2usr/lib/*/libnm.so
3usr/include/libnm/3usr/include/libnm/
4usr/share/gtk-doc/html/libnm/4usr/share/gtk-doc/html/libnm/
5usr/share/gir-1.0/NM-1.0.gir5#usr/share/gir-1.0/NM-1.0.gir
diff --git a/debian/network-manager.install b/debian/network-manager.install
index c1012ff..950b918 100644
--- a/debian/network-manager.install
+++ b/debian/network-manager.install
@@ -10,7 +10,7 @@ usr/lib/*/NetworkManager/libnm-settings-plugin-ibft.so
10usr/lib/*/NetworkManager/libnm-settings-plugin-ofono.so10usr/lib/*/NetworkManager/libnm-settings-plugin-ofono.so
11usr/lib/*/NetworkManager/libnm-device-plugin-*.so11usr/lib/*/NetworkManager/libnm-device-plugin-*.so
12usr/lib/*/NetworkManager/libnm-wwan.so12usr/lib/*/NetworkManager/libnm-wwan.so
13usr/lib/pppd/*/*.so13#usr/lib/pppd/*/*.so
14usr/share/doc/NetworkManager/examples/14usr/share/doc/NetworkManager/examples/
15usr/share/locale/15usr/share/locale/
16usr/share/man/16usr/share/man/
diff --git a/debian/patches/Add-modem-reconnect-delay-to-policy.patch b/debian/patches/Add-modem-reconnect-delay-to-policy.patch
17new file mode 10064417new file mode 100644
index 0000000..5bdb503
--- /dev/null
+++ b/debian/patches/Add-modem-reconnect-delay-to-policy.patch
@@ -0,0 +1,115 @@
1From: Tony Espy <espy@canonical.com>
2Date: Tue, 24 May 2016 20:59:42 -0400
3Subject: Add modem reconnect delay to policy
4
5This patch introduces a 5s delay between retry activations
6for modem devices. Otherwise, the activation attempts can
7flood the modem all at once, and then trigger the reset_retries
8timeout ( which defaults to 300s ).
9
10Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593
11---
12 src/nm-policy.c | 34 +++++++++++++++++++++++++++-------
13 1 file changed, 27 insertions(+), 7 deletions(-)
14
15diff --git a/src/nm-policy.c b/src/nm-policy.c
16index 07bcce8..5c59604 100644
17--- a/src/nm-policy.c
18+++ b/src/nm-policy.c
19@@ -931,7 +931,7 @@ sleeping_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data)
20 }
21
22 static void
23-schedule_activate_check (NMPolicy *self, NMDevice *device)
24+schedule_activate_check (NMPolicy *self, NMDevice *device, guint delay)
25 {
26 NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self);
27 ActivateData *data;
28@@ -960,7 +960,12 @@ schedule_activate_check (NMPolicy *self, NMDevice *device)
29 data = g_slice_new0 (ActivateData);
30 data->policy = self;
31 data->device = g_object_ref (device);
32- data->autoactivate_id = g_idle_add (auto_activate_device, data);
33+
34+ if (delay)
35+ data->autoactivate_id = g_timeout_add_seconds (delay, auto_activate_device, data);
36+ else
37+ data->autoactivate_id = g_idle_add (auto_activate_device, data);
38+
39 priv->pending_activation_checks = g_slist_append (priv->pending_activation_checks, data);
40 }
41
42@@ -1155,6 +1160,7 @@ device_state_changed (NMDevice *device,
43 NMIP4Config *ip4_config;
44 NMIP6Config *ip6_config;
45 NMSettingConnection *s_con = NULL;
46+ guint delay = 0;
47
48 switch (new_state) {
49 case NM_DEVICE_STATE_FAILED:
50@@ -1172,7 +1178,7 @@ device_state_changed (NMDevice *device,
51
52 nm_settings_connection_set_autoconnect_blocked_reason (connection, NM_DEVICE_STATE_REASON_NO_SECRETS);
53 } else if (tries > 0) {
54- _LOGD (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left",
55+ _LOGI (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left",
56 nm_settings_connection_get_id (connection), tries);
57 nm_settings_connection_set_autoconnect_retries (connection, tries - 1);
58 }
59@@ -1183,6 +1189,10 @@ device_state_changed (NMDevice *device,
60 /* Schedule a handler to reset retries count */
61 if (!priv->reset_retries_id) {
62 gint32 retry_time = nm_settings_connection_get_autoconnect_retry_time (connection);
63+ gint32 actual_time = MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ());
64+
65+ _LOGI (LOGD_DEVICE, "Disabling autoconnect for connection '%s'; setting retry of %d.",
66+ nm_connection_get_id (NM_CONNECTION (connection)), actual_time);
67
68 g_warn_if_fail (retry_time != 0);
69 priv->reset_retries_id = g_timeout_add_seconds (MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ()), reset_connections_retries, self);
70@@ -1250,7 +1260,17 @@ device_state_changed (NMDevice *device,
71 update_routing_and_dns (self, FALSE);
72
73 /* Device is now available for auto-activation */
74- schedule_activate_check (self, device);
75+ if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_MODEM)
76+ delay = 5;
77+
78+ if (connection)
79+ _LOGI (LOGD_DEVICE, "Connection '%s' disconnected, scheduling activate_check in %u seconds.",
80+ nm_connection_get_id (NM_CONNECTION (connection)), delay);
81+ else
82+ _LOGI (LOGD_DEVICE, "Device '%s' has no connection; scheduling activate_check in %u seconds.",
83+ nm_device_get_iface (device), delay);
84+
85+ schedule_activate_check (self, device, delay);
86 break;
87
88 case NM_DEVICE_STATE_PREPARE:
89@@ -1363,7 +1383,7 @@ device_autoconnect_changed (NMDevice *device,
90 NMPolicy *self = priv->self;
91
92 if (nm_device_autoconnect_allowed (device))
93- schedule_activate_check (self, device);
94+ schedule_activate_check (self, device, 0);
95 }
96
97 static void
98@@ -1372,7 +1392,7 @@ device_recheck_auto_activate (NMDevice *device, gpointer user_data)
99 NMPolicyPrivate *priv = user_data;
100 NMPolicy *self = priv->self;
101
102- schedule_activate_check (self, device);
103+ schedule_activate_check (self, device, 0);
104 }
105
106 static void
107@@ -1586,7 +1606,7 @@ schedule_activate_all (NMPolicy *self)
108 const GSList *iter;
109
110 for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter))
111- schedule_activate_check (self, NM_DEVICE (iter->data));
112+ schedule_activate_check (self, NM_DEVICE (iter->data), 0);
113 }
114
115 static void
diff --git a/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch b/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
index 3fc4826..a10ac51 100644
--- a/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
+++ b/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
@@ -6,7 +6,7 @@ This patch adds get/set methods to NMSettingsConnection for the
6reset_retries_timeout. This allows sub-classes to override the6reset_retries_timeout. This allows sub-classes to override the
7default setting ( 300s ).7default setting ( 300s ).
88
9Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/14615939Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593
10---10---
11 src/settings/nm-settings-connection.c | 18 +++++++++++++++++-11 src/settings/nm-settings-connection.c | 18 +++++++++++++++++-
12 src/settings/nm-settings-connection.h | 3 +++12 src/settings/nm-settings-connection.h | 3 +++
diff --git a/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch b/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
13new file mode 10064413new file mode 100644
index 0000000..814de4b
--- /dev/null
+++ b/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
@@ -0,0 +1,32 @@
1From: Tony Espy <espy@canonical.com>
2Date: Tue, 24 May 2016 21:19:06 -0400
3Subject: Add sudo policy to DBus conf for indicator-network
4
5This patch adds a 'sudo' group DBus policy to allow
6indicator-network to interact with the NetworkManager and
7NetworkManager.SecretAgent interfaces.
8
9This was previously handled by a dirty hack/hook in the
10livecd-rootfs tool used to build touch images.
11
12---
13 src/org.freedesktop.NetworkManager.conf | 5 +++++
14 1 file changed, 5 insertions(+)
15
16diff --git a/src/org.freedesktop.NetworkManager.conf b/src/org.freedesktop.NetworkManager.conf
17index 35ed4e7..58e6c7f 100644
18--- a/src/org.freedesktop.NetworkManager.conf
19+++ b/src/org.freedesktop.NetworkManager.conf
20@@ -2,6 +2,12 @@
21 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
22 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
23 <busconfig>
24+ <policy group="sudo">
25+ <allow send_destination="org.freedesktop.NetworkManager"
26+ send_interface="org.freedesktop.NetworkManager"/>
27+ <allow send_destination="org.freedesktop.NetworkManager"
28+ send_interface="org.freedesktop.NetworkManager.SecretAgent"/>
29+ </policy>
30 <policy user="root">
31 <allow own="org.freedesktop.NetworkManager"/>
32 <allow send_destination="org.freedesktop.NetworkManager"/>
diff --git a/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch
0new file mode 10064433new file mode 100644
index 0000000..88f9891
--- /dev/null
+++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch
@@ -0,0 +1,38 @@
1From: Tony Espy <espy@canonical.com>
2Date: Tue, 24 May 2016 21:36:20 -0400
3Subject: Clear WiFi requested_scan if suppl exits
4
5It's possible for wpa_supplicant to exit with an
6outstanding requested_scan pending. This can lead
7to a stall condition where scanning no longer occurs.
8---
9 src/devices/wifi/nm-device-wifi.c | 9 ++++++++-
10 1 file changed, 8 insertions(+), 1 deletion(-)
11
12diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
13index f6325a6..b147409 100644
14--- a/src/devices/wifi/nm-device-wifi.c
15+++ b/src/devices/wifi/nm-device-wifi.c
16@@ -246,6 +246,13 @@ supplicant_interface_release (NMDeviceWifi *self)
17
18 priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
19
20+ if (priv->requested_scan) {
21+ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): reset requested_scan flag to FALSE",
22+ nm_device_get_iface (NM_DEVICE (self)));
23+ priv->requested_scan = FALSE;
24+ nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE);
25+ }
26+
27 nm_clear_g_source (&priv->pending_scan_id);
28
29 /* Reset the scan interval to be pretty frequent when disconnected */
30@@ -1915,7 +1922,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
31 priv->requested_scan = FALSE;
32 }
33
34- cancel_pending_scan (self);
35+ nm_clear_g_source (&priv->pending_scan_id);
36 request_wireless_scan (self, NULL);
37 }
38 default:
diff --git a/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch b/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
0new file mode 10064439new file mode 100644
index 0000000..d81b534
--- /dev/null
+++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
@@ -0,0 +1,37 @@
1From: Tony Espy <espy@canonical.com>
2Date: Tue, 24 May 2016 21:22:48 -0400
3Subject: Clear WiFi requested_scan if suppl goes INACTIVE
4
5It's possible for wpa_supplicant to transition to INACTIVE
6state with an outstanding requested_scan pending. This can
7lead to a stall condition where scanning no longer occurs.
8---
9 src/devices/wifi/nm-device-wifi.c | 15 +++++++++++++++
10 1 file changed, 15 insertions(+)
11
12diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
13index bacd5e6..f6325a6 100644
14--- a/src/devices/wifi/nm-device-wifi.c
15+++ b/src/devices/wifi/nm-device-wifi.c
16@@ -1903,6 +1903,21 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
17 else
18 _LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up");
19 break;
20+ case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE:
21+ if (old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) {
22+ nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): supplicant state: SCANNING -> INACTIVE",
23+ nm_device_get_iface (NM_DEVICE (self)));
24+
25+ if (priv->requested_scan) {
26+ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): clearing requested_scan",
27+ nm_device_get_iface (NM_DEVICE (self)));
28+
29+ priv->requested_scan = FALSE;
30+ }
31+
32+ cancel_pending_scan (self);
33+ request_wireless_scan (self, NULL);
34+ }
35 default:
36 break;
37 }
diff --git a/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch b/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
index fae01f9..648dd6f 100644
--- a/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
+++ b/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
@@ -3,6 +3,7 @@ Date: Fri, 13 May 2016 11:00:11 +0800
3Subject: Filter DNS servers to add to dnsmasq based on availability and VPN3Subject: Filter DNS servers to add to dnsmasq based on availability and VPN
4 status4 status
55
6Bug-Ubuntu: https://bugs.launchpad.net/bugs/898224
6---7---
7 src/dns-manager/nm-dns-dnsmasq.c | 47 +++++++++++++++++++++++++++++++++-------8 src/dns-manager/nm-dns-dnsmasq.c | 47 +++++++++++++++++++++++++++++++++-------
8 1 file changed, 39 insertions(+), 8 deletions(-)9 1 file changed, 39 insertions(+), 8 deletions(-)
diff --git a/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch b/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
9new file mode 10064410new file mode 100644
index 0000000..9a538f0
--- /dev/null
+++ b/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
@@ -0,0 +1,32 @@
1From: Tony Espy <espy@canonical.com>
2Date: Tue, 24 May 2016 21:41:18 -0400
3Subject: Fix openvpn by handling do_add_route EEXISTS
4
5This patch fixes issues with the updated Netlink code in
6NMLinuxPlatform and ineroperability with older ( <= 3.10 )
7kernels.
8
9Add EEXIST logic similar to logic found in 0.9.10 to the
10NMLinuxPlatform do_add_addroute().
11
12Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579222
13---
14 src/platform/nm-linux-platform.c | 5 +++++
15 1 file changed, 5 insertions(+)
16
17diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
18index c504550..f453b6e 100644
19--- a/src/platform/nm-linux-platform.c
20+++ b/src/platform/nm-linux-platform.c
21@@ -3915,6 +3915,11 @@ do_add_addrroute (NMPlatform *platform, const NMPObject *obj_id, struct nl_msg *
22 obj = nmp_cache_lookup_obj (priv->cache, obj_id);
23 }
24
25+ if (seq_result == -EEXIST) {
26+ _LOGI ("do_add_addroute: seq_restul == -EEXISTS; treating as OK");
27+ seq_result = WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK;
28+ }
29+
30 /* Adding is only successful, if kernel reported success *and* we have the
31 * expected object in cache afterwards. */
32 return obj && seq_result == WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK;
diff --git a/debian/patches/Ignore-p2p-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch
0new file mode 10064433new file mode 100644
index 0000000..c09e7d3
--- /dev/null
+++ b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch
@@ -0,0 +1,34 @@
1From: Tony Espy <espy@canonical.com>
2Date: Fri, 3 Jun 2016 15:50:53 -0400
3Subject: Ignore p2p wifi devices from android
4
5This patch causes NMManager to ignore any p2p WiFi
6devices exposed by Android WiFi drivers.
7
8Bug-Ubuntu: https://bugs.launchpad.net/bugs/1099983
9---
10 src/nm-manager.c | 11 +++++++++++
11 1 file changed, 11 insertions(+)
12
13diff --git a/src/nm-manager.c b/src/nm-manager.c
14index c2ed1da..8cf70c7 100644
15--- a/src/nm-manager.c
16+++ b/src/nm-manager.c
17@@ -2097,6 +2097,17 @@ platform_link_added (NMManager *self,
18 return;
19 }
20
21+ /*
22+ * Ubuntu: Explicitly unmanage all p2p Wi-Fi devices which are
23+ * managed externally in the case of Wi-Fi Direct.
24+ */
25+ NMDeviceType devtype = nm_device_get_device_type (device);
26+ if ((plink->type == NM_LINK_TYPE_WIFI)
27+ && g_strstr_len (plink->name, NM_STRLEN ("p2p"), "p2p")) {
28+ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name);
29+ return;
30+ }
31+
32 device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error);
33 if (!device) {
34 if (!ignore) {
diff --git a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch
0deleted file mode 10064435deleted file mode 100644
index c567c96..0000000
--- a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2Date: Fri, 13 May 2016 11:08:30 +0800
3Subject: Ignore p2p0 wifi devices from android.
4
5---
6 src/nm-manager.c | 10 ++++++++++
7 1 file changed, 10 insertions(+)
8
9diff --git a/src/nm-manager.c b/src/nm-manager.c
10index 769662c..b770139 100644
11--- a/src/nm-manager.c
12+++ b/src/nm-manager.c
13@@ -2105,6 +2105,16 @@ platform_link_added (NMManager *self,
14 !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni")))
15 return;
16
17+ /*
18+ * Ubuntu: Explicitly unmanage p2p Wi-Fi devices exposed by Android JB Wi-Fi drivers.
19+ */
20+ NMDeviceType devtype = nm_device_get_device_type (device);
21+ if ((plink->type == NM_LINK_TYPE_WIFI)
22+ && !strncmp (plink->name, "p2p0", NM_STRLEN ("p2p0"))) {
23+ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name);
24+ return;
25+ }
26+
27 if (device == NULL) {
28 switch (plink->type) {
29 case NM_LINK_TYPE_WWAN_ETHERNET:
diff --git a/debian/patches/Ignore-rild-modem-devices.patch b/debian/patches/Ignore-rild-modem-devices.patch
30new file mode 1006440new file mode 100644
index 0000000..c0cc6ae
--- /dev/null
+++ b/debian/patches/Ignore-rild-modem-devices.patch
@@ -0,0 +1,27 @@
1From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2Date: Fri, 13 May 2016 11:08:17 +0800
3Subject: Ignore rild modem devices.
4
5---
6 src/nm-manager.c | 8 ++++++++
7 1 file changed, 8 insertions(+)
8
9diff --git a/src/nm-manager.c b/src/nm-manager.c
10index 10aa3d7..c2ed1da 100644
11--- a/src/nm-manager.c
12+++ b/src/nm-manager.c
13@@ -2089,6 +2089,14 @@ platform_link_added (NMManager *self,
14 gboolean ignore = FALSE;
15 gs_free_error GError *error = NULL;
16
17+ /* Ignore rild modem devices, which will be handled by their modem parent */
18+ if (g_strstr_len (plink->name, NM_STRLEN ("rmnet"), "rmnet") ||
19+ g_strstr_len (plink->name, NM_STRLEN ("rev_rmnet"), "rev_rmnet") ||
20+ g_strstr_len (plink->name, NM_STRLEN ("ccmni"), "ccmni")) {
21+ _LOGW (LOGD_HW, "Ignoring rild modem device: %s", plink->name);
22+ return;
23+ }
24+
25 device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error);
26 if (!device) {
27 if (!ignore) {
diff --git a/debian/patches/Ignore-rmnet_usbX-devices.patch b/debian/patches/Ignore-rmnet_usbX-devices.patch
0deleted file mode 10064428deleted file mode 100644
index f973a5f..0000000
--- a/debian/patches/Ignore-rmnet_usbX-devices.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2Date: Fri, 13 May 2016 11:08:17 +0800
3Subject: Ignore rmnet_usbX devices.
4
5---
6 src/nm-manager.c | 6 ++++++
7 1 file changed, 6 insertions(+)
8
9diff --git a/src/nm-manager.c b/src/nm-manager.c
10index 10aa3d7..769662c 100644
11--- a/src/nm-manager.c
12+++ b/src/nm-manager.c
13@@ -2099,6 +2099,12 @@ platform_link_added (NMManager *self,
14 }
15 }
16
17+ /* Ignore rmnet_usb devices, which will be handled by their modem parent
18+ */
19+ if (!strncmp (plink->name, "rmnet_usb", NM_STRLEN ("rmnet_usb")) ||
20+ !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni")))
21+ return;
22+
23 if (device == NULL) {
24 switch (plink->type) {
25 case NM_LINK_TYPE_WWAN_ETHERNET:
diff --git a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
index 1630362..6f5a018 100644
--- a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
+++ b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
@@ -9,16 +9,16 @@ meaning the device is in such a state that it can be activated.
9This change prevents NM from trying to activate a modem which9This change prevents NM from trying to activate a modem which
10is not yet ready to be activated.10is not yet ready to be activated.
1111
12Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/144508012Bug-Ubuntu: https://bugs.launchpad.net/bugs/1445080
13---13---
14 src/devices/wwan/nm-device-modem.c | 7 ++++---14 src/devices/wwan/nm-device-modem.c | 7 ++++---
15 1 file changed, 4 insertions(+), 3 deletions(-)15 1 file changed, 4 insertions(+), 3 deletions(-)
1616
17diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c17diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
18index a7523f5..774fd24 10064418index 39a34db..3bbd170 100644
19--- a/src/devices/wwan/nm-device-modem.c19--- a/src/devices/wwan/nm-device-modem.c
20+++ b/src/devices/wwan/nm-device-modem.c20+++ b/src/devices/wwan/nm-device-modem.c
21@@ -428,14 +428,15 @@ check_connection_available (NMDevice *device,21@@ -410,14 +410,15 @@ check_connection_available (NMDevice *device,
22 return FALSE;22 return FALSE;
23 23
24 state = nm_modem_get_state (priv->modem);24 state = nm_modem_get_state (priv->modem);
@@ -36,7 +36,7 @@ index a7523f5..774fd24 100644
36 return TRUE;36 return TRUE;
37 }37 }
38 38
39@@ -616,7 +617,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)39@@ -598,7 +599,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
40 40
41 g_assert (priv->modem);41 g_assert (priv->modem);
42 modem_state = nm_modem_get_state (priv->modem);42 modem_state = nm_modem_get_state (priv->modem);
diff --git a/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch b/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
index 83d8940..0d67e33 100644
--- a/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
+++ b/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
@@ -13,6 +13,8 @@ This is a very simple implementation of such re-ordering, just add the IPv6
13nameservers first when building the list of IP configurations (which will13nameservers first when building the list of IP configurations (which will
14include nameservers, search domains, etc.), the IPv4 data will be appended14include nameservers, search domains, etc.), the IPv4 data will be appended
15right after.15right after.
16
17Bug-Ubuntu: https://bugs.launchpad.net/bugs/936712
16---18---
17 src/dns-manager/nm-dns-manager.c | 8 ++++----19 src/dns-manager/nm-dns-manager.c | 8 ++++----
18 1 file changed, 4 insertions(+), 4 deletions(-)20 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/debian/patches/Set-the-default-powersave-value-to-enabled.patch b/debian/patches/Set-the-default-powersave-value-to-enabled.patch
19deleted file mode 10064421deleted file mode 100644
index 7449719..0000000
--- a/debian/patches/Set-the-default-powersave-value-to-enabled.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2Date: Fri, 13 May 2016 11:08:10 +0800
3Subject: Set the default powersave value to enabled
4
5This is an Ubuntu-specific patch to enable wireless powersave by default.
6
7Should it not work for you for some reason, you can safely add:
8
9powersave=0
10
11to the section:
12[802-11-wireless]
13
14In the configuration file for your connection under
15/etc/NetworkManager/system-connections/.
16---
17 libnm-util/nm-setting-wireless.c | 7 +++++--
18 1 file changed, 5 insertions(+), 2 deletions(-)
19
20diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
21index 234d7ba..613539d 100644
22--- a/libnm-util/nm-setting-wireless.c
23+++ b/libnm-util/nm-setting-wireless.c
24@@ -675,7 +675,7 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting)
25 guint32
26 nm_setting_wireless_get_powersave (NMSettingWireless *setting)
27 {
28- g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
29+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 1);
30
31 return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave;
32 }
33@@ -885,6 +885,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
34 static void
35 nm_setting_wireless_init (NMSettingWireless *setting)
36 {
37+ NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
38+
39+ priv->powersave = 1;
40 }
41
42 static void
43@@ -1283,7 +1286,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
44 g_object_class_install_property
45 (object_class, PROP_POWERSAVE,
46 g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "",
47- 0, G_MAXUINT32, 0,
48+ 0, G_MAXUINT32, 1,
49 G_PARAM_READWRITE |
50 G_PARAM_STATIC_STRINGS));
51 }
diff --git a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
index 45b668e..f96673b 100644
--- a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
+++ b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
@@ -79,7 +79,7 @@ index 2495bbc..49028f1 100644
79 if SUSPEND_RESUME_UPOWER79 if SUSPEND_RESUME_UPOWER
80 libNetworkManager_la_SOURCES += nm-sleep-monitor-upower.c80 libNetworkManager_la_SOURCES += nm-sleep-monitor-upower.c
81diff --git a/src/nm-manager.c b/src/nm-manager.c81diff --git a/src/nm-manager.c b/src/nm-manager.c
82index b770139..04b0a43 10064482index 8cf70c7..8f45b0f 100644
83--- a/src/nm-manager.c83--- a/src/nm-manager.c
84+++ b/src/nm-manager.c84+++ b/src/nm-manager.c
85@@ -34,6 +34,7 @@85@@ -34,6 +34,7 @@
@@ -108,7 +108,7 @@ index b770139..04b0a43 100644
108 108
109 gboolean startup;109 gboolean startup;
110 gboolean devices_inited;110 gboolean devices_inited;
111@@ -5210,6 +5215,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr,111@@ -5213,6 +5218,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr,
112 112
113 /**********************************************************************/113 /**********************************************************************/
114 114
@@ -158,7 +158,7 @@ index b770139..04b0a43 100644
158 NM_DEFINE_SINGLETON_REGISTER (NMManager);158 NM_DEFINE_SINGLETON_REGISTER (NMManager);
159 159
160 NMManager *160 NMManager *
161@@ -5231,6 +5279,44 @@ nm_connection_provider_get (void)161@@ -5234,6 +5282,44 @@ nm_connection_provider_get (void)
162 return p;162 return p;
163 }163 }
164 164
@@ -203,7 +203,7 @@ index b770139..04b0a43 100644
203 NMManager *203 NMManager *
204 nm_manager_setup (const char *state_file,204 nm_manager_setup (const char *state_file,
205 gboolean initial_net_enabled,205 gboolean initial_net_enabled,
206@@ -5311,16 +5397,38 @@ constructed (GObject *object)206@@ -5314,16 +5400,38 @@ constructed (GObject *object)
207 "rfkill-changed",207 "rfkill-changed",
208 G_CALLBACK (rfkill_manager_rfkill_changed_cb),208 G_CALLBACK (rfkill_manager_rfkill_changed_cb),
209 self);209 self);
diff --git a/debian/patches/Update-dnsmasq-parameters.patch b/debian/patches/Update-dnsmasq-parameters.patch
index 20d8f91..3b83b82 100644
--- a/debian/patches/Update-dnsmasq-parameters.patch
+++ b/debian/patches/Update-dnsmasq-parameters.patch
@@ -6,7 +6,7 @@ Disable caching since it's a potential security issue (local dns cache poisoning
66
7See also: https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving7See also: https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving
88
9=== modified file 'src/dns-manager/nm-dns-dnsmasq.c'9Bug-Ubuntu: https://bugs.launchpad.net/bugs/903854
10---10---
11 src/dns-manager/nm-dns-dnsmasq.c | 4 ++--11 src/dns-manager/nm-dns-dnsmasq.c | 4 ++--
12 src/dns-manager/nm-dns-manager.c | 6 +++---12 src/dns-manager/nm-dns-manager.c | 6 +++---
diff --git a/debian/patches/series b/debian/patches/series
index f0a8f73..421ffe9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,13 +12,18 @@ Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
12Revert-wifi-disable-Ad-Hoc-WPA-connections-lp-905748.patch12Revert-wifi-disable-Ad-Hoc-WPA-connections-lp-905748.patch
13Replace-Ad-Hoc-WPA-None-support-with-IBSS-RSN-PSK.patch13Replace-Ad-Hoc-WPA-None-support-with-IBSS-RSN-PSK.patch
14wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch14wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch
15Set-the-default-powersave-value-to-enabled.patch15Ignore-rild-modem-devices.patch
16Ignore-rmnet_usbX-devices.patch16Ignore-p2p-wifi-devices-from-android.patch
17Ignore-p2p0-wifi-devices-from-android.patch
18wwan-add-support-for-using-oFono-as-a-modem-manager.patch17wwan-add-support-for-using-oFono-as-a-modem-manager.patch
19Add-new-NMSettingsConnection-reset_retries-get-set-m.patch18Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
20Let-NetworkManager-read-oFono-settings-file-and-crea.patch19Let-NetworkManager-read-oFono-settings-file-and-crea.patch
20Add-modem-reconnect-delay-to-policy.patch
21Modify-NMDeviceModem-s-available-logic.patch21Modify-NMDeviceModem-s-available-logic.patch
22Track-killswitch-change-signals-from-urfkill.patch22Track-killswitch-change-signals-from-urfkill.patch
23Only-test-team-devices-if-we-built-support-for-them.patch23Only-test-team-devices-if-we-built-support-for-them.patch
24Disable-general-with-expect-which-tends-to-fail-on-p.patch24Disable-general-with-expect-which-tends-to-fail-on-p.patch
25Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
26Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
27Clear-WiFi-requested_scan-if-suppl-exits.patch
28Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
29wwan-fix-ofono-connection-problems.patch
diff --git a/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch b/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
index cd18c65..377ec85 100644
--- a/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
+++ b/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
@@ -8,13 +8,13 @@ Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
8---8---
9 configure.ac | 9 +9 configure.ac | 9 +
10 src/devices/wwan/Makefile.am | 7 +10 src/devices/wwan/Makefile.am | 7 +
11 src/devices/wwan/nm-device-modem.c | 20 +11 src/devices/wwan/nm-device-modem.c | 2 +
12 src/devices/wwan/nm-modem-manager.c | 220 +++++-12 src/devices/wwan/nm-modem-manager.c | 241 +++++-
13 src/devices/wwan/nm-modem-ofono.c | 1449 +++++++++++++++++++++++++++++++++++13 src/devices/wwan/nm-modem-ofono.c | 1436 +++++++++++++++++++++++++++++++++++
14 src/devices/wwan/nm-modem-ofono.h | 64 ++14 src/devices/wwan/nm-modem-ofono.h | 64 ++
15 src/devices/wwan/nm-modem.c | 8 +-15 src/devices/wwan/nm-modem.c | 8 +-
16 src/nm-core-utils.c | 20 +-16 src/nm-core-utils.c | 20 +-
17 8 files changed, 1787 insertions(+), 10 deletions(-)17 8 files changed, 1766 insertions(+), 21 deletions(-)
18 create mode 100644 src/devices/wwan/nm-modem-ofono.c18 create mode 100644 src/devices/wwan/nm-modem-ofono.c
19 create mode 100644 src/devices/wwan/nm-modem-ofono.h19 create mode 100644 src/devices/wwan/nm-modem-ofono.h
2020
@@ -57,7 +57,7 @@ index 1777eb3..65d9952 100644
57 57
58 libnm_wwan_la_LDFLAGS = \58 libnm_wwan_la_LDFLAGS = \
59diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c59diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
60index a8361c4..a7523f5 10064460index a8361c4..39a34db 100644
61--- a/src/devices/wwan/nm-device-modem.c61--- a/src/devices/wwan/nm-device-modem.c
62+++ b/src/devices/wwan/nm-device-modem.c62+++ b/src/devices/wwan/nm-device-modem.c
63@@ -100,6 +100,7 @@ modem_prepare_result (NMModem *modem,63@@ -100,6 +100,7 @@ modem_prepare_result (NMModem *modem,
@@ -68,39 +68,7 @@ index a8361c4..a7523f5 100644
68 if (reason == NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT) {68 if (reason == NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT) {
69 /* If the connect failed because the SIM PIN was wrong don't allow69 /* If the connect failed because the SIM PIN was wrong don't allow
70 * the device to be auto-activated anymore, which would risk locking70 * the device to be auto-activated anymore, which would risk locking
71@@ -282,6 +283,16 @@ modem_state_cb (NMModem *modem,71@@ -545,6 +546,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid)
72 }
73 }
74
75+ if (dev_state >= NM_DEVICE_STATE_DISCONNECTED &&
76+ new_state == NM_MODEM_STATE_REGISTERED && old_state < NM_MODEM_STATE_REGISTERED) {
77+
78+ nm_log_info (LOGD_MB, "(%s): modem re-registered; re-checking autoconnect",
79+ nm_device_get_iface (device));
80+
81+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL);
82+ nm_device_emit_recheck_auto_activate (device);
83+ }
84+
85 if (new_state < NM_MODEM_STATE_CONNECTING &&
86 old_state >= NM_MODEM_STATE_CONNECTING &&
87 dev_state >= NM_DEVICE_STATE_NEED_AUTH &&
88@@ -345,6 +356,14 @@ device_state_changed (NMDevice *device,
89 nm_modem_state_to_string (nm_modem_get_state (priv->modem)));
90 }
91
92+ /* Block autoconnect until the modem is registered again */
93+ if (new_state == NM_DEVICE_STATE_FAILED && nm_modem_get_state (priv->modem) == NM_MODEM_STATE_SEARCHING) {
94+ nm_log_info (LOGD_MB, "(%s): modem searching; disabling autoconnect",
95+ nm_device_get_iface (device));
96+
97+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL);
98+ }
99+
100 nm_modem_device_state_changed (priv->modem, new_state, old_state, reason);
101
102 switch (reason) {
103@@ -545,6 +564,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid)
104 72
105 g_return_val_if_fail (priv->modem, FALSE);73 g_return_val_if_fail (priv->modem, FALSE);
106 success = nm_modem_get_iid (priv->modem, out_iid);74 success = nm_modem_get_iid (priv->modem, out_iid);
@@ -109,7 +77,7 @@ index a8361c4..a7523f5 100644
109 success = NM_DEVICE_CLASS (nm_device_modem_parent_class)->get_ip_iface_identifier (device, out_iid);77 success = NM_DEVICE_CLASS (nm_device_modem_parent_class)->get_ip_iface_identifier (device, out_iid);
110 return success;78 return success;
111diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c79diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c
112index 9e9bc13..0d1ec78 10064480index 9e9bc13..cd97b87 100644
113--- a/src/devices/wwan/nm-modem-manager.c81--- a/src/devices/wwan/nm-modem-manager.c
114+++ b/src/devices/wwan/nm-modem-manager.c82+++ b/src/devices/wwan/nm-modem-manager.c
115@@ -17,7 +17,7 @@83@@ -17,7 +17,7 @@
@@ -251,7 +219,7 @@ index 9e9bc13..0d1ec78 100644
251+{219+{
252+ gchar *name_owner;220+ gchar *name_owner;
253+221+
254+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (self->priv->ofono_proxy));222+ name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (self->priv->ofono_proxy));
255+ if (name_owner) {223+ if (name_owner) {
256+ /* Available! */224+ /* Available! */
257+ ofono_appeared (self);225+ ofono_appeared (self);
@@ -324,7 +292,37 @@ index 9e9bc13..0d1ec78 100644
324 292
325 static void293 static void
326 modem_manager_poke_cb (GDBusConnection *connection,294 modem_manager_poke_cb (GDBusConnection *connection,
327@@ -336,22 +518,44 @@ manager_new_ready (GObject *source,295@@ -233,19 +415,18 @@ modem_manager_poke_cb (GDBusConnection *connection,
296
297 result = g_dbus_connection_call_finish (connection, res, &error);
298 if (error) {
299- /* Ignore common errors when MM is not installed and such */
300- if ( !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)
301- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_EXEC_FAILED)
302- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FORK_FAILED)
303- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FAILED)
304- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_TIMEOUT)
305- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
306- nm_log_dbg (LOGD_MB, "error poking ModemManager: %s", error->message);
307+ nm_log_warn (LOGD_MB, "error poking ModemManager: %s",
308+ error ? error->message : "");
309+
310+ /* Don't reschedule poke is MM service doesn't exist. */
311+ if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)
312+ && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
313+
314+ /* Setup timeout to relaunch */
315+ schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL);
316 }
317- g_error_free (error);
318
319- /* Setup timeout to relaunch */
320- schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL);
321+ g_error_free (error);
322 } else
323 g_variant_unref (result);
324
325@@ -336,22 +517,44 @@ manager_new_ready (GObject *source,
328 static void326 static void
329 ensure_client (NMModemManager *self)327 ensure_client (NMModemManager *self)
330 {328 {
@@ -373,7 +371,7 @@ index 9e9bc13..0d1ec78 100644
373 }371 }
374 372
375 static void373 static void
376@@ -430,6 +634,12 @@ dispose (GObject *object)374@@ -430,6 +633,12 @@ dispose (GObject *object)
377 375
378 modem_manager_clear_signals (self);376 modem_manager_clear_signals (self);
379 g_clear_object (&self->priv->modem_manager);377 g_clear_object (&self->priv->modem_manager);
@@ -388,10 +386,10 @@ index 9e9bc13..0d1ec78 100644
388 if (self->priv->modems) {386 if (self->priv->modems) {
389diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c387diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c
390new file mode 100644388new file mode 100644
391index 0000000..162b88d389index 0000000..4566be0
392--- /dev/null390--- /dev/null
393+++ b/src/devices/wwan/nm-modem-ofono.c391+++ b/src/devices/wwan/nm-modem-ofono.c
394@@ -0,0 +1,1449 @@392@@ -0,0 +1,1436 @@
395+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */393+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
396+/* NetworkManager -- Network link manager394+/* NetworkManager -- Network link manager
397+ *395+ *
@@ -604,12 +602,7 @@ index 0000000..162b88d
604+ nm_log_dbg (LOGD_MB, "(%s): modem disconnected",602+ nm_log_dbg (LOGD_MB, "(%s): modem disconnected",
605+ nm_modem_get_uid (NM_MODEM (self)));603+ nm_modem_get_uid (NM_MODEM (self)));
606+604+
607+ /* NOTES(1.2): This doesn't accomplish anything as none of the attributes that605+ update_modem_state (self);
608+ * are checked by update_modem_state are changed by this function!
609+ *
610+ * update_modem_state (self);
611+ */
612+
613+ disconnect_context_complete (ctx);606+ disconnect_context_complete (ctx);
614+}607+}
615+608+
@@ -784,7 +777,7 @@ index 0000000..162b88d
784+ &error);777+ &error);
785+ if (!v_properties) {778+ if (!v_properties) {
786+ g_dbus_error_strip_remote_error (error);779+ g_dbus_error_strip_remote_error (error);
787+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: %s",780+ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: %s",
788+ nm_modem_get_uid (NM_MODEM (self)),781+ nm_modem_get_uid (NM_MODEM (self)),
789+ error->message);782+ error->message);
790+ g_error_free (error);783+ g_error_free (error);
@@ -795,7 +788,7 @@ index 0000000..162b88d
795+788+
796+ v_dict = g_variant_get_child_value (v_properties, 0);789+ v_dict = g_variant_get_child_value (v_properties, 0);
797+ if (!v_dict) {790+ if (!v_dict) {
798+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: no v_dict",791+ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: no v_dict",
799+ nm_modem_get_uid (NM_MODEM (self)));792+ nm_modem_get_uid (NM_MODEM (self)));
800+ return;793+ return;
801+ }794+ }
@@ -897,7 +890,7 @@ index 0000000..162b88d
897+ gboolean attached = g_variant_get_boolean (v);890+ gboolean attached = g_variant_get_boolean (v);
898+891+
899+ nm_log_dbg (LOGD_MB, "(%s): Attached: %s",892+ nm_log_dbg (LOGD_MB, "(%s): Attached: %s",
900+ nm_modem_get_uid (NM_MODEM (self)), property ? "True" : "False");893+ nm_modem_get_uid (NM_MODEM (self)), attached ? "True" : "False");
901+894+
902+ if (priv->gprs_attached != attached) {895+ if (priv->gprs_attached != attached) {
903+ priv->gprs_attached = attached;896+ priv->gprs_attached = attached;
@@ -941,7 +934,7 @@ index 0000000..162b88d
941+ &error);934+ &error);
942+ if (!v_properties) {935+ if (!v_properties) {
943+ g_dbus_error_strip_remote_error (error);936+ g_dbus_error_strip_remote_error (error);
944+ nm_log_warn (LOGD_BT, "(%s) error getting connman properties: %s",937+ nm_log_warn (LOGD_MB, "(%s) error getting connman properties: %s",
945+ nm_modem_get_uid (NM_MODEM (self)),938+ nm_modem_get_uid (NM_MODEM (self)),
946+ error->message);939+ error->message);
947+ g_error_free (error);940+ g_error_free (error);
@@ -1121,7 +1114,7 @@ index 0000000..162b88d
1121+ &error);1114+ &error);
1122+ if (!v_properties) {1115+ if (!v_properties) {
1123+ g_dbus_error_strip_remote_error (error);1116+ g_dbus_error_strip_remote_error (error);
1124+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: %s",1117+ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: %s",
1125+ nm_modem_get_uid (NM_MODEM (self)),1118+ nm_modem_get_uid (NM_MODEM (self)),
1126+ error->message);1119+ error->message);
1127+ g_error_free (error);1120+ g_error_free (error);
@@ -1130,7 +1123,7 @@ index 0000000..162b88d
1130+1123+
1131+ v_dict = g_variant_get_child_value (v_properties, 0);1124+ v_dict = g_variant_get_child_value (v_properties, 0);
1132+ if (!v_dict) {1125+ if (!v_dict) {
1133+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: no v_dict",1126+ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: no v_dict",
1134+ nm_modem_get_uid (NM_MODEM (self)));1127+ nm_modem_get_uid (NM_MODEM (self)));
1135+ return;1128+ return;
1136+ }1129+ }
@@ -1226,14 +1219,6 @@ index 0000000..162b88d
1226+ nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);1219+ nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
1227+1220+
1228+ /*1221+ /*
1229+ * 0.9.10.x:
1230+ *
1231+ * The old code got PropertyChanged for Settings, and then immediately
1232+ * called 'GetProperties' to get the current values of 'Settings'.
1233+ *
1234+ * There's no need to do this, as the PropertyChanged has the value of
1235+ * 'Settings' as its payload!!!
1236+ *
1237+ * TODO: might be a good idea and re-factor this to mimic bluez-device,1222+ * TODO: might be a good idea and re-factor this to mimic bluez-device,
1238+ * ie. have this function just check the key, and call a sub-func to1223+ * ie. have this function just check the key, and call a sub-func to
1239+ * handle the action.1224+ * handle the action.
@@ -1242,24 +1227,14 @@ index 0000000..162b88d
1242+ if (g_strcmp0 (property, "Settings") != 0)1227+ if (g_strcmp0 (property, "Settings") != 0)
1243+ return;1228+ return;
1244+1229+
1245+ nm_log_dbg (LOGD_MB, "found 'Settings' DICTIONARY property");
1246+
1247+ if (nm_modem_get_state (NM_MODEM (self)) == NM_MODEM_STATE_CONNECTED && g_variant_n_children (v) <= 0) {
1248+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings empty", nm_modem_get_uid (NM_MODEM (self)));
1249+
1250+ goto out;
1251+ }
1252+
1253+ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static configuration:", nm_modem_get_uid (NM_MODEM (self)));
1254+
1255+ v_dict = g_variant_get_child_value (v, 0);1230+ v_dict = g_variant_get_child_value (v, 0);
1256+ if (!v_dict) {1231+ if (!v_dict) {
1257+ nm_log_warn (LOGD_BT, "ofono: (%s): error getting IPv4 Settings: no v_dict",1232+ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
1258+ nm_modem_get_uid (NM_MODEM (self)));1233+ nm_modem_get_uid (NM_MODEM (self)));
1259+ return;1234+ goto out;
1260+ }1235+ }
1261+1236+
1262+ /* NOTE - 0.9.10x code didn't fail if 'Interface' missing */1237+ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
1263+1238+
1264+ if (g_variant_lookup (v_dict, "Interface", "&s", &s)) {1239+ if (g_variant_lookup (v_dict, "Interface", "&s", &s)) {
1265+1240+
@@ -1271,7 +1246,7 @@ index 0000000..162b88d
1271+ NM_MODEM_IP4_METHOD, NM_MODEM_IP_METHOD_STATIC,1246+ NM_MODEM_IP4_METHOD, NM_MODEM_IP_METHOD_STATIC,
1272+ NULL);1247+ NULL);
1273+ } else {1248+ } else {
1274+ nm_log_warn (LOGD_BT, "ofono: (%s): Settings 'Interface'; empty",1249+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Interface'; empty",
1275+ nm_modem_get_uid (NM_MODEM (self)));1250+ nm_modem_get_uid (NM_MODEM (self)));
1276+ goto out;1251+ goto out;
1277+ }1252+ }
@@ -1323,6 +1298,7 @@ index 0000000..162b88d
1323+ } else {1298+ } else {
1324+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Address' missing",1299+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Address' missing",
1325+ nm_modem_get_uid (NM_MODEM (self)));1300+ nm_modem_get_uid (NM_MODEM (self)));
1301+ goto out;
1326+ }1302+ }
1327+1303+
1328+ if (g_variant_lookup (v_dict, "Netmask", "&s", &s)) {1304+ if (g_variant_lookup (v_dict, "Netmask", "&s", &s)) {
@@ -1345,7 +1321,9 @@ index 0000000..162b88d
1345+ goto out;1321+ goto out;
1346+ }1322+ }
1347+1323+
1348+ nm_log_info (LOGD_MB, " address %s/%d", addr_s, prefix);1324+ nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d",
1325+ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
1326+
1349+ nm_ip4_config_add_address (priv->ip4_config, &addr);1327+ nm_ip4_config_add_address (priv->ip4_config, &addr);
1350+1328+
1351+ if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) {1329+ if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) {
@@ -1372,7 +1350,7 @@ index 0000000..162b88d
1372+1350+
1373+ while (*iter) {1351+ while (*iter) {
1374+ if (ip_string_to_network_address (*iter, &address_network) && address_network > 0) {1352+ if (ip_string_to_network_address (*iter, &address_network) && address_network > 0) {
1375+ nm_log_info (LOGD_MB, "ofono: (%s): DNS %s",1353+ nm_log_info (LOGD_MB, "ofono: (%s): DNS: %s",
1376+ nm_modem_get_uid (NM_MODEM (self)), *iter);1354+ nm_modem_get_uid (NM_MODEM (self)), *iter);
1377+1355+
1378+ nm_ip4_config_add_nameserver (priv->ip4_config, address_network);1356+ nm_ip4_config_add_nameserver (priv->ip4_config, address_network);
@@ -1384,13 +1362,15 @@ index 0000000..162b88d
1384+ *iter++;1362+ *iter++;
1385+ }1363+ }
1386+1364+
1387+ /* TOOD: check for minimum NameServers >= 1? */1365+ if (iter == array) {
1366+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified",
1367+ nm_modem_get_uid (NM_MODEM (self)));
1368+ g_free (array);
1369+ goto out;
1370+ }
1388+1371+
1389+ g_free (array);1372+ g_free (array);
1390+ } else {1373+ } else {
1391+
1392+ /* NOTE - 0.9.10.x would not throw an error in this case!!! */
1393+
1394+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'DomainNameServers' missing",1374+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'DomainNameServers' missing",
1395+ nm_modem_get_uid (NM_MODEM (self)));1375+ nm_modem_get_uid (NM_MODEM (self)));
1396+ goto out;1376+ goto out;
@@ -1419,14 +1399,19 @@ index 0000000..162b88d
1419+ ret = TRUE;1399+ ret = TRUE;
1420+1400+
1421+out:1401+out:
1422+ if (!ret)1402+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) {
1423+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;1403+ nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s",
1404+ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
1424+1405+
1425+ nm_log_dbg (LOGD_MB, "(%s): DONE w/Settings; ret: %s",1406+ if (!ret)
1426+ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");1407+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
1427+1408+
1428+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED)
1429+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, ret, reason);1409+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, ret, reason);
1410+ } else {
1411+ nm_log_warn (LOGD_MB, "ofono: (%s): MODEM_PPP_FAILED", nm_modem_get_uid (NM_MODEM (self)));
1412+
1413+ g_signal_emit_by_name (self, NM_MODEM_PPP_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED);
1414+ }
1430+}1415+}
1431+1416+
1432+static NMActStageReturn1417+static NMActStageReturn
diff --git a/debian/patches/wwan-fix-ofono-connection-problems.patch b/debian/patches/wwan-fix-ofono-connection-problems.patch
1433new file mode 1006441418new file mode 100644
index 0000000..bff500d
--- /dev/null
+++ b/debian/patches/wwan-fix-ofono-connection-problems.patch
@@ -0,0 +1,343 @@
1From: Tony Espy <espy@canonical.com>
2Date: Fri, 3 Jun 2016 18:03:32 -0400
3Subject: Fix ofono connection problems
4
5This patch fixes three (re) connection problems with
6the ofono plugin:
7
81) If the modem is connected, and registrations drops,
9and then is restored, the connection isn't re-activated.
10The fix was simply to change modem_state_cb to not return
11after setting the state to failed, which allows nm_device_
12queue_recheck_available to be called, which queues a state
13transition to UNAVAILABLE.
14
152) If ofono returns InProgress, don't treat as a PREPARE_FAILURE.
16
173) If the ofono conext is already active, use it's existing
18'Settings' property to configure the device.
19
20Bug-Ubuntu: https://bugs.launchpad.net/bugs/1565717
21Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579098
22---
23 src/devices/wwan/nm-device-modem.c | 4 +-
24 src/devices/wwan/nm-modem-ofono.c | 193 +++++++++++++++++++++++++++----------
25 src/devices/wwan/nm-modem-ofono.h | 2 +
26 3 files changed, 145 insertions(+), 54 deletions(-)
27
28diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
29index 3bbd170..22009f8 100644
30--- a/src/devices/wwan/nm-device-modem.c
31+++ b/src/devices/wwan/nm-device-modem.c
32@@ -286,12 +286,10 @@ modem_state_cb (NMModem *modem,
33 if (new_state < NM_MODEM_STATE_CONNECTING &&
34 old_state >= NM_MODEM_STATE_CONNECTING &&
35 dev_state >= NM_DEVICE_STATE_NEED_AUTH &&
36- dev_state <= NM_DEVICE_STATE_ACTIVATED) {
37+ dev_state <= NM_DEVICE_STATE_ACTIVATED)
38 /* Fail the device if the modem disconnects unexpectedly while the
39 * device is activating/activated. */
40 nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER);
41- return;
42- }
43
44 if (new_state > NM_MODEM_STATE_LOCKED && old_state == NM_MODEM_STATE_LOCKED) {
45 /* If the modem is now unlocked, enable/disable it according to the
46diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c
47index 4566be0..c09cfd5 100644
48--- a/src/devices/wwan/nm-modem-ofono.c
49+++ b/src/devices/wwan/nm-modem-ofono.c
50@@ -789,42 +789,35 @@ stage1_prepare_done (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data
51 g_dbus_proxy_call_finish (proxy, result, &error);
52
53 if (error) {
54- nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s",
55- error ? error->code : -1,
56- error && error->message ? error->message : "(unknown)");
57+ if (!g_strstr_len (error->message, NM_STRLEN (OFONO_ERROR_IN_PROGRESS), OFONO_ERROR_IN_PROGRESS)) {
58+ nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s",
59+ error ? error->code : -1,
60+ error && error->message ? error->message : "(unknown)");
61
62- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
63- NM_DEVICE_STATE_REASON_MODEM_BUSY);
64- /*
65- * FIXME: add code to check for InProgress so that the
66- * connection doesn't continue to try and activate,
67- * leading to the connection being disabled, and a 5m
68- * timeout...
69- */
70+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
71+ NM_DEVICE_STATE_REASON_MODEM_BUSY);
72+ } else
73+ nm_log_warn (LOGD_MB, "ofono: connection activation returned Error.InProgress");
74
75 g_clear_error (&error);
76 }
77 }
78
79 static void
80-context_property_changed (GDBusProxy *proxy,
81- const char *property,
82- GVariant *v,
83- gpointer user_data)
84+handle_settings (GVariant *v_dict, gpointer user_data)
85 {
86 NMModemOfono *self = NM_MODEM_OFONO (user_data);
87 NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
88 NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE;
89 NMPlatformIP4Address addr;
90 gboolean ret = FALSE;
91- GVariant *v_dict;
92 GVariantIter i;
93 const gchar *s, *addr_s;
94 const gchar **array, **iter;
95 guint32 address_network, gateway_network;
96 guint prefix = 0;
97
98- nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
99+ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
100
101 /*
102 * TODO: might be a good idea and re-factor this to mimic bluez-device,
103@@ -832,18 +825,6 @@ context_property_changed (GDBusProxy *proxy,
104 * handle the action.
105 */
106
107- if (g_strcmp0 (property, "Settings") != 0)
108- return;
109-
110- v_dict = g_variant_get_child_value (v, 0);
111- if (!v_dict) {
112- nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
113- nm_modem_get_uid (NM_MODEM (self)));
114- goto out;
115- }
116-
117- nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
118-
119 if (g_variant_lookup (v_dict, "Interface", "&s", &s)) {
120
121 nm_log_dbg (LOGD_MB, "(%s): Interface: %s", nm_modem_get_uid (NM_MODEM (self)), s);
122@@ -930,8 +911,7 @@ context_property_changed (GDBusProxy *proxy,
123 }
124
125 nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d",
126- nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
127-
128+ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
129 nm_ip4_config_add_address (priv->ip4_config, &addr);
130
131 if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) {
132@@ -972,7 +952,7 @@ context_property_changed (GDBusProxy *proxy,
133
134 if (iter == array) {
135 nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified",
136- nm_modem_get_uid (NM_MODEM (self)));
137+ nm_modem_get_uid (NM_MODEM (self)));
138 g_free (array);
139 goto out;
140 }
141@@ -1009,7 +989,7 @@ context_property_changed (GDBusProxy *proxy,
142 out:
143 if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) {
144 nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s",
145- nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
146+ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
147
148 if (!ret)
149 reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
150@@ -1022,6 +1002,33 @@ out:
151 }
152 }
153
154+static void
155+context_property_changed (GDBusProxy *proxy,
156+ const char *property,
157+ GVariant *v,
158+ gpointer user_data)
159+{
160+ NMModemOfono *self = NM_MODEM_OFONO (user_data);
161+ GVariant *v_dict;
162+
163+ nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
164+
165+ if (g_strcmp0 (property, "Settings") != 0)
166+ return;
167+
168+ v_dict = g_variant_get_child_value (v, 0);
169+ if (!v_dict) {
170+ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
171+ nm_modem_get_uid (NM_MODEM (self)));
172+ return;
173+ }
174+
175+ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT));
176+
177+ handle_settings (v_dict, user_data);
178+ g_variant_unref (v_dict);
179+}
180+
181 static NMActStageReturn
182 static_stage3_ip4_config_start (NMModem *_self,
183 NMActRequest *req,
184@@ -1053,11 +1060,100 @@ static_stage3_ip4_config_start (NMModem *_self,
185 }
186
187 static void
188+context_properties_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
189+{
190+ NMModemOfono *self = NM_MODEM_OFONO (user_data);
191+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
192+ GError *error = NULL;
193+ GVariant *properties, *settings;
194+ GVariant *v_dict = NULL;
195+ gboolean active;
196+
197+ nm_log_dbg (LOGD_MB, "in %s", __func__);
198+
199+ properties = g_dbus_proxy_call_finish (proxy, result, &error);
200+
201+ if (error) {
202+ nm_log_warn (LOGD_MB, "ofono: connection failed; couldn't read context properties (%d) %s",
203+ error ? error->code : -1,
204+ error && error->message ? error->message : "(unknown)");
205+
206+ g_clear_error (&error);
207+ goto error;
208+ }
209+
210+ if (properties == NULL) {
211+ nm_log_warn (LOGD_MB, "ofono: connection failed; no context properties returned");
212+ goto error;
213+ }
214+
215+ v_dict = g_variant_get_child_value (properties, 0);
216+ g_assert (v_dict);
217+ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT));
218+
219+ g_variant_unref (properties);
220+
221+ if (!g_variant_lookup (v_dict, "Active", "b", &active)) {
222+ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Active' property");
223+ goto error;
224+ }
225+
226+ /* Watch for custom ofono PropertyChanged signals */
227+ _nm_dbus_signal_connect (priv->context_proxy,
228+ "PropertyChanged",
229+ G_VARIANT_TYPE ("(sv)"),
230+ G_CALLBACK (context_property_changed),
231+ self);
232+
233+ if (active) {
234+ nm_log_dbg (LOGD_MB, "connection is already Active");
235+
236+ settings = g_variant_lookup_value (v_dict, "Settings", G_VARIANT_TYPE_VARDICT);
237+ if (settings == NULL) {
238+ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Settings' property");
239+ goto error;
240+ }
241+
242+ handle_settings (settings, user_data);
243+ g_variant_unref (settings);
244+
245+ } else
246+ g_dbus_proxy_call (priv->context_proxy,
247+ "SetProperty",
248+ g_variant_new ("(sv)",
249+ "Active",
250+ g_variant_new ("b", TRUE)),
251+ G_DBUS_CALL_FLAGS_NONE,
252+ 20000,
253+ NULL,
254+ (GAsyncReadyCallback) stage1_prepare_done,
255+ g_object_ref (self));
256+
257+ g_variant_unref (v_dict);
258+
259+ return;
260+
261+error:
262+ if (properties)
263+ g_variant_unref (properties);
264+
265+ if (v_dict)
266+ g_variant_unref (v_dict);
267+
268+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
269+ NM_DEVICE_STATE_REASON_MODEM_BUSY);
270+}
271+
272+static void
273 context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
274 {
275 NMModemOfono *self = NM_MODEM_OFONO (user_data);
276 NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
277+ gboolean context_active;
278 GError *error = NULL;
279+ GVariant *v_dict;
280+ GVariant *active_property;
281+ GVariant *settings_property;
282
283 nm_log_dbg (LOGD_MB, "%s:", __func__);
284
285@@ -1087,23 +1183,18 @@ context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_dat
286 if (priv->ip4_config)
287 g_clear_object (&priv->ip4_config);
288
289- /* Watch for custom ofono PropertyChanged signals */
290- _nm_dbus_signal_connect (priv->context_proxy,
291- "PropertyChanged",
292- G_VARIANT_TYPE ("(sv)"),
293- G_CALLBACK (context_property_changed),
294- self);
295-
296+ /* As ofono doesn't properly implement DBus.Properties, we need to
297+ * query the ConnectionContextinteface directly to get the current
298+ * property values vs. using g_dbus_proxy_get_cached_property.
299+ */
300 g_dbus_proxy_call (priv->context_proxy,
301- "SetProperty",
302- g_variant_new ("(sv)",
303- "Active",
304- g_variant_new ("b", TRUE)),
305- G_DBUS_CALL_FLAGS_NONE,
306- 20000,
307- NULL,
308- (GAsyncReadyCallback) stage1_prepare_done,
309- g_object_ref (self));
310+ "GetProperties",
311+ NULL,
312+ G_DBUS_CALL_FLAGS_NONE,
313+ 20000,
314+ NULL,
315+ (GAsyncReadyCallback) context_properties_cb,
316+ g_object_ref (self));
317 }
318
319 static void
320@@ -1112,8 +1203,8 @@ do_context_activate (NMModemOfono *self)
321 NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
322 GValue value = G_VALUE_INIT;
323
324- g_return_val_if_fail (self != NULL, FALSE);
325- g_return_val_if_fail (NM_IS_MODEM_OFONO (self), FALSE);
326+ g_assert (self != NULL);
327+ g_assert (NM_IS_MODEM_OFONO (self));
328
329 nm_log_dbg (LOGD_MB, "in %s", __func__);
330
331diff --git a/src/devices/wwan/nm-modem-ofono.h b/src/devices/wwan/nm-modem-ofono.h
332index fa79e15..02eca11 100644
333--- a/src/devices/wwan/nm-modem-ofono.h
334+++ b/src/devices/wwan/nm-modem-ofono.h
335@@ -41,6 +41,8 @@ G_BEGIN_DECLS
336 #define OFONO_DBUS_INTERFACE_CONNECTION_CONTEXT "org.ofono.ConnectionContext"
337 #define OFONO_DBUS_INTERFACE_SIM_MANAGER "org.ofono.SimManager"
338
339+#define OFONO_ERROR_IN_PROGRESS "org.ofono.Error.InProgress"
340+
341 typedef enum {
342 NM_OFONO_ERROR_CONNECTION_NOT_OFONO = 0, /*< nick=ConnectionNotOfono >*/
343 NM_OFONO_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/
diff --git a/debian/rules b/debian/rules
index 2e449a4..801508c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,11 +2,24 @@
22
3include /usr/share/dpkg/architecture.mk3include /usr/share/dpkg/architecture.mk
44
5PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)5# The following line is used by 1.2x desktop, but doesn't
6# work on vivid or wily, preventing a source package from
7# being built on this releases. This is because ppp 2.4.6-3*
8# doesn't include dh_ppp.
9#
10# PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)
6DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)11DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
712
8%:13%:
9 dh $@ --with gir,systemd,autoreconf,ppp --parallel14# This is from the 1.2x desktop branch; ppp fails due to lack of
15# dh_ppp ( see above ). This is a no-op until we fix pptp VPN
16# on the phone. gir fails when building the binary packages with
17# the error:
18#
19# dh_girepository: Could not find gir file for NM-1.0.typelib
20#
21# dh $@ --with gir,systemd,autoreconf,ppp --parallel
22 dh $@ --with systemd,autoreconf --parallel
1023
11autoreconf:24autoreconf:
12 gtkdocize --copy25 gtkdocize --copy
@@ -19,14 +32,13 @@ override_dh_autoreconf:
19override_dh_auto_configure:32override_dh_auto_configure:
20 dh_auto_configure -- \33 dh_auto_configure -- \
21 --libexecdir=/usr/lib/NetworkManager \34 --libexecdir=/usr/lib/NetworkManager \
22 --with-pppd-plugin-dir=$(PPPD_PLUGIN_DIR) \
23 --with-pppd=/usr/sbin/pppd \
24 --with-resolvconf=/sbin/resolvconf \35 --with-resolvconf=/sbin/resolvconf \
25 --with-dhclient=/sbin/dhclient \36 --with-dhclient=/sbin/dhclient \
26 --with-iptables=/sbin/iptables \37 --with-iptables=/sbin/iptables \
27 --with-dnsmasq=/usr/sbin/dnsmasq \38 --with-dnsmasq=/usr/sbin/dnsmasq \
28 --with-dnssec-trigger=/usr/lib/dnssec-trigger/dnssec-trigger-script \39 --with-dnssec-trigger=/usr/lib/dnssec-trigger/dnssec-trigger-script \
29 --with-systemdsystemunitdir=/lib/systemd/system \40 --with-systemdsystemunitdir=/lib/systemd/system \
41 --with-systemd-journal=no \
30 --with-udev-dir=/lib/udev \42 --with-udev-dir=/lib/udev \
31 --with-crypto=gnutls \43 --with-crypto=gnutls \
32 --with-session-tracking=systemd \44 --with-session-tracking=systemd \
@@ -36,9 +48,9 @@ override_dh_auto_configure:
36 --with-nmcli \48 --with-nmcli \
37 --disable-more-warnings \49 --disable-more-warnings \
38 --disable-modify-system \50 --disable-modify-system \
51 --disable-bluez5 \
39 --enable-polkit \52 --enable-polkit \
40 --enable-polkit-agent \53 --enable-polkit-agent \
41 --enable-ppp \
42 --enable-ifupdown \54 --enable-ifupdown \
43 --enable-config-plugin-ibft \55 --enable-config-plugin-ibft \
44 --enable-introspection \56 --enable-introspection \
@@ -46,8 +58,7 @@ override_dh_auto_configure:
46 --enable-concheck \58 --enable-concheck \
47 --enable-teamdctl=no \59 --enable-teamdctl=no \
48 --enable-vala \60 --enable-vala \
49 --with-tests \61 --with-tests
50 --enable-bluez5-dun
5162
52override_dh_install:63override_dh_install:
53 rm -vf $(CURDIR)/debian/tmp/etc/init.d/NetworkManager64 rm -vf $(CURDIR)/debian/tmp/etc/init.d/NetworkManager
@@ -60,6 +71,15 @@ override_dh_install:
60 mkdir -p debian/network-manager/etc/dnsmasq.d71 mkdir -p debian/network-manager/etc/dnsmasq.d
61 cp debian/network-manager.dnsmasq debian/network-manager/etc/dnsmasq.d/network-manager72 cp debian/network-manager.dnsmasq debian/network-manager/etc/dnsmasq.d/network-manager
6273
74 # copy indicator-network polkit configuration
75 mkdir -p debian/network-manager/etc/polkit-1/localauthority/50-local.d
76 cp debian/indicator-network.pkla \
77 debian/network-manager/etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla
78
79 # copy powersave configuration
80 mkdir -p debian/network-manager/etc/NetworkManager/conf.d
81 cp debian/default-wifi-powersave-on.conf debian/network-manager/etc/NetworkManager/conf.d/
82
63override_dh_installinit:83override_dh_installinit:
64 dh_installinit --noscripts84 dh_installinit --noscripts
6585
@@ -67,7 +87,7 @@ override_dh_makeshlibs:
67 dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/NetworkManager/ -X/usr/lib/pppd/87 dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/NetworkManager/ -X/usr/lib/pppd/
6888
69override_dh_strip:89override_dh_strip:
70 dh_strip --dbgsym-migration='network-manager-dbg (<< 1.1.91-2~)'90 dh_strip --dbg-package=network-manager-dbg
7191
72override_dh_systemd_start:92override_dh_systemd_start:
73 dh_link lib/systemd/system/NetworkManager.service \93 dh_link lib/systemd/system/NetworkManager.service \
@@ -76,9 +96,6 @@ override_dh_systemd_start:
76 dh_systemd_start -pnetwork-manager --no-start NetworkManager-wait-online.service96 dh_systemd_start -pnetwork-manager --no-start NetworkManager-wait-online.service
77 dh_systemd_start -pnetwork-manager --restart-after-upgrade NetworkManager.service97 dh_systemd_start -pnetwork-manager --restart-after-upgrade NetworkManager.service
7898
79override_dh_ppp:
80 dh_ppp --breaks
81
82override_dh_auto_test:99override_dh_auto_test:
83ifeq (, $(filter nocheck, $(DEB_BUILD_OPTIONS)))100ifeq (, $(filter nocheck, $(DEB_BUILD_OPTIONS)))
84 make check || ( find . -name test-suite.log -exec cat {} \;; exit 1; )101 make check || ( find . -name test-suite.log -exec cat {} \;; exit 1; )

Subscribers

People subscribed via source and target branches

to all changes: