Merge ~awe/network-manager/+git/ubuntu:touch-xenial2 into network-manager:touch-xenial
- Git
- lp:~awe/network-manager/+git/ubuntu
- touch-xenial2
- Merge into touch-xenial
Status: | Merged |
---|---|
Approved by: | Mathieu Trudel-Lapierre |
Approved revision: | ee11f06450b7e9e55d8e7252221caf363a60ac2e |
Merged at revision: | c8a58596e06fcad53135d63113f0bb25bb3f93b8 |
Proposed branch: | ~awe/network-manager/+git/ubuntu:touch-xenial2 |
Merge into: | network-manager:touch-xenial |
Diff against target: |
1456 lines (+812/-156) 22 files modified
debian/changelog (+20/-0) debian/control (+18/-0) debian/default-wifi-powersave-on.conf (+2/-0) debian/indicator-network.pkla (+6/-0) 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 (+13/-3) dev/null (+0/-51) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Simon Fels | Approve | ||
Review via email: mp+296508@code.launchpad.net |
Commit message
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.
Simon Fels (morphis) wrote : | # |
Uuups, that should have been a single approve :-)
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 893a649..d601495 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,23 @@ |
6 | +network-manager (1.2.2-0ubuntu1~xenial1) UNRELEASED; urgency=medium |
7 | + |
8 | + * Backported to xenial for Ubuntu Touch: |
9 | + - Added d/indicator-network.pkla: policy kit config |
10 | + - Modified d/rules: disable bluez, disable systemd-journal, |
11 | + and install indicator-network polkit config. |
12 | + Modified d/control: restored -dbg package |
13 | + - Re-sync d/p/Ignore* nm-manager device patches from Touch |
14 | + - Re-synced d/p/wwan-add-support* patch from Touch |
15 | + - Re-stored patches from Touch: |
16 | + - Add-modem-reconnect-delay* (LP: #1461593) |
17 | + - indicator-network DBus 'sudo' policy |
18 | + - wpa_suppl scan fixes |
19 | + - OpenVPN EEXISTS bug (LP: #1579222) |
20 | + - Removed d/p/Set-the-default-powersave*.patch, and instead install |
21 | + a config file that accomplishes the same (LP: #1557026). |
22 | + - Add d/p/wwan-fix-ofono-connection-problems (LP: #1565717, #1579098). |
23 | + |
24 | + -- Tony Espy <espy@canonical.com> Tue, 24 May 2016 15:30:42 -0400 |
25 | + |
26 | network-manager (1.2.2-0ubuntu1) yakkety; urgency=medium |
27 | |
28 | * Rebase to upstream stable point release. (LP: #1574347) |
29 | diff --git a/debian/control b/debian/control |
30 | index 354dfd7..7e1e7a5 100644 |
31 | --- a/debian/control |
32 | +++ b/debian/control |
33 | @@ -248,6 +248,24 @@ Description: GObject-based client library for NetworkManager (development files) |
34 | . |
35 | This package contains header and development files. |
36 | |
37 | +Package: network-manager-dbg |
38 | +Architecture: linux-any |
39 | +Section: debug |
40 | +Priority: extra |
41 | +Depends: ${misc:Depends}, |
42 | + network-manager (= ${binary:Version}), |
43 | + libnm-util2 (= ${binary:Version}), |
44 | + libnm-glib4 (= ${binary:Version}), |
45 | + libnm-glib-vpn1 (= ${binary:Version}) |
46 | +Description: network management framework (debugging symbols) |
47 | + NetworkManager is a system network service that manages your network devices |
48 | + and connections, attempting to keep active network connectivity when |
49 | + available. It manages ethernet, WiFi, mobile broadband (WWAN), and PPPoE |
50 | + devices, and provides VPN integration with a variety of different VPN |
51 | + services. |
52 | + . |
53 | + This package contains detached debugging symbols. |
54 | + |
55 | Package: gir1.2-networkmanager-1.0 |
56 | Section: introspection |
57 | Architecture: linux-any |
58 | diff --git a/debian/default-wifi-powersave-on.conf b/debian/default-wifi-powersave-on.conf |
59 | new file mode 100644 |
60 | index 0000000..0580544 |
61 | --- /dev/null |
62 | +++ b/debian/default-wifi-powersave-on.conf |
63 | @@ -0,0 +1,2 @@ |
64 | +[connection] |
65 | +wifi.powersave = 3 |
66 | \ No newline at end of file |
67 | diff --git a/debian/indicator-network.pkla b/debian/indicator-network.pkla |
68 | new file mode 100644 |
69 | index 0000000..4e64cae |
70 | --- /dev/null |
71 | +++ b/debian/indicator-network.pkla |
72 | @@ -0,0 +1,6 @@ |
73 | +[indicator-network-service] |
74 | +Identity=unix-group:sudo |
75 | +Action=org.freedesktop.NetworkManager.* |
76 | +ResultAny=yes |
77 | +ResultInactive=no |
78 | +ResultActive=yes |
79 | diff --git a/debian/patches/Add-modem-reconnect-delay-to-policy.patch b/debian/patches/Add-modem-reconnect-delay-to-policy.patch |
80 | new file mode 100644 |
81 | index 0000000..5bdb503 |
82 | --- /dev/null |
83 | +++ b/debian/patches/Add-modem-reconnect-delay-to-policy.patch |
84 | @@ -0,0 +1,115 @@ |
85 | +From: Tony Espy <espy@canonical.com> |
86 | +Date: Tue, 24 May 2016 20:59:42 -0400 |
87 | +Subject: Add modem reconnect delay to policy |
88 | + |
89 | +This patch introduces a 5s delay between retry activations |
90 | +for modem devices. Otherwise, the activation attempts can |
91 | +flood the modem all at once, and then trigger the reset_retries |
92 | +timeout ( which defaults to 300s ). |
93 | + |
94 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593 |
95 | +--- |
96 | + src/nm-policy.c | 34 +++++++++++++++++++++++++++------- |
97 | + 1 file changed, 27 insertions(+), 7 deletions(-) |
98 | + |
99 | +diff --git a/src/nm-policy.c b/src/nm-policy.c |
100 | +index 07bcce8..5c59604 100644 |
101 | +--- a/src/nm-policy.c |
102 | ++++ b/src/nm-policy.c |
103 | +@@ -931,7 +931,7 @@ sleeping_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) |
104 | + } |
105 | + |
106 | + static void |
107 | +-schedule_activate_check (NMPolicy *self, NMDevice *device) |
108 | ++schedule_activate_check (NMPolicy *self, NMDevice *device, guint delay) |
109 | + { |
110 | + NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); |
111 | + ActivateData *data; |
112 | +@@ -960,7 +960,12 @@ schedule_activate_check (NMPolicy *self, NMDevice *device) |
113 | + data = g_slice_new0 (ActivateData); |
114 | + data->policy = self; |
115 | + data->device = g_object_ref (device); |
116 | +- data->autoactivate_id = g_idle_add (auto_activate_device, data); |
117 | ++ |
118 | ++ if (delay) |
119 | ++ data->autoactivate_id = g_timeout_add_seconds (delay, auto_activate_device, data); |
120 | ++ else |
121 | ++ data->autoactivate_id = g_idle_add (auto_activate_device, data); |
122 | ++ |
123 | + priv->pending_activation_checks = g_slist_append (priv->pending_activation_checks, data); |
124 | + } |
125 | + |
126 | +@@ -1155,6 +1160,7 @@ device_state_changed (NMDevice *device, |
127 | + NMIP4Config *ip4_config; |
128 | + NMIP6Config *ip6_config; |
129 | + NMSettingConnection *s_con = NULL; |
130 | ++ guint delay = 0; |
131 | + |
132 | + switch (new_state) { |
133 | + case NM_DEVICE_STATE_FAILED: |
134 | +@@ -1172,7 +1178,7 @@ device_state_changed (NMDevice *device, |
135 | + |
136 | + nm_settings_connection_set_autoconnect_blocked_reason (connection, NM_DEVICE_STATE_REASON_NO_SECRETS); |
137 | + } else if (tries > 0) { |
138 | +- _LOGD (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left", |
139 | ++ _LOGI (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left", |
140 | + nm_settings_connection_get_id (connection), tries); |
141 | + nm_settings_connection_set_autoconnect_retries (connection, tries - 1); |
142 | + } |
143 | +@@ -1183,6 +1189,10 @@ device_state_changed (NMDevice *device, |
144 | + /* Schedule a handler to reset retries count */ |
145 | + if (!priv->reset_retries_id) { |
146 | + gint32 retry_time = nm_settings_connection_get_autoconnect_retry_time (connection); |
147 | ++ gint32 actual_time = MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ()); |
148 | ++ |
149 | ++ _LOGI (LOGD_DEVICE, "Disabling autoconnect for connection '%s'; setting retry of %d.", |
150 | ++ nm_connection_get_id (NM_CONNECTION (connection)), actual_time); |
151 | + |
152 | + g_warn_if_fail (retry_time != 0); |
153 | + priv->reset_retries_id = g_timeout_add_seconds (MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ()), reset_connections_retries, self); |
154 | +@@ -1250,7 +1260,17 @@ device_state_changed (NMDevice *device, |
155 | + update_routing_and_dns (self, FALSE); |
156 | + |
157 | + /* Device is now available for auto-activation */ |
158 | +- schedule_activate_check (self, device); |
159 | ++ if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_MODEM) |
160 | ++ delay = 5; |
161 | ++ |
162 | ++ if (connection) |
163 | ++ _LOGI (LOGD_DEVICE, "Connection '%s' disconnected, scheduling activate_check in %u seconds.", |
164 | ++ nm_connection_get_id (NM_CONNECTION (connection)), delay); |
165 | ++ else |
166 | ++ _LOGI (LOGD_DEVICE, "Device '%s' has no connection; scheduling activate_check in %u seconds.", |
167 | ++ nm_device_get_iface (device), delay); |
168 | ++ |
169 | ++ schedule_activate_check (self, device, delay); |
170 | + break; |
171 | + |
172 | + case NM_DEVICE_STATE_PREPARE: |
173 | +@@ -1363,7 +1383,7 @@ device_autoconnect_changed (NMDevice *device, |
174 | + NMPolicy *self = priv->self; |
175 | + |
176 | + if (nm_device_autoconnect_allowed (device)) |
177 | +- schedule_activate_check (self, device); |
178 | ++ schedule_activate_check (self, device, 0); |
179 | + } |
180 | + |
181 | + static void |
182 | +@@ -1372,7 +1392,7 @@ device_recheck_auto_activate (NMDevice *device, gpointer user_data) |
183 | + NMPolicyPrivate *priv = user_data; |
184 | + NMPolicy *self = priv->self; |
185 | + |
186 | +- schedule_activate_check (self, device); |
187 | ++ schedule_activate_check (self, device, 0); |
188 | + } |
189 | + |
190 | + static void |
191 | +@@ -1586,7 +1606,7 @@ schedule_activate_all (NMPolicy *self) |
192 | + const GSList *iter; |
193 | + |
194 | + for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter)) |
195 | +- schedule_activate_check (self, NM_DEVICE (iter->data)); |
196 | ++ schedule_activate_check (self, NM_DEVICE (iter->data), 0); |
197 | + } |
198 | + |
199 | + static void |
200 | 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 |
201 | index 3fc4826..a10ac51 100644 |
202 | --- a/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch |
203 | +++ b/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch |
204 | @@ -6,7 +6,7 @@ This patch adds get/set methods to NMSettingsConnection for the |
205 | reset_retries_timeout. This allows sub-classes to override the |
206 | default setting ( 300s ). |
207 | |
208 | -Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1461593 |
209 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593 |
210 | --- |
211 | src/settings/nm-settings-connection.c | 18 +++++++++++++++++- |
212 | src/settings/nm-settings-connection.h | 3 +++ |
213 | 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 |
214 | new file mode 100644 |
215 | index 0000000..814de4b |
216 | --- /dev/null |
217 | +++ b/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch |
218 | @@ -0,0 +1,32 @@ |
219 | +From: Tony Espy <espy@canonical.com> |
220 | +Date: Tue, 24 May 2016 21:19:06 -0400 |
221 | +Subject: Add sudo policy to DBus conf for indicator-network |
222 | + |
223 | +This patch adds a 'sudo' group DBus policy to allow |
224 | +indicator-network to interact with the NetworkManager and |
225 | +NetworkManager.SecretAgent interfaces. |
226 | + |
227 | +This was previously handled by a dirty hack/hook in the |
228 | +livecd-rootfs tool used to build touch images. |
229 | + |
230 | +--- |
231 | + src/org.freedesktop.NetworkManager.conf | 5 +++++ |
232 | + 1 file changed, 5 insertions(+) |
233 | + |
234 | +diff --git a/src/org.freedesktop.NetworkManager.conf b/src/org.freedesktop.NetworkManager.conf |
235 | +index 35ed4e7..58e6c7f 100644 |
236 | +--- a/src/org.freedesktop.NetworkManager.conf |
237 | ++++ b/src/org.freedesktop.NetworkManager.conf |
238 | +@@ -2,6 +2,12 @@ |
239 | + "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" |
240 | + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> |
241 | + <busconfig> |
242 | ++ <policy group="sudo"> |
243 | ++ <allow send_destination="org.freedesktop.NetworkManager" |
244 | ++ send_interface="org.freedesktop.NetworkManager"/> |
245 | ++ <allow send_destination="org.freedesktop.NetworkManager" |
246 | ++ send_interface="org.freedesktop.NetworkManager.SecretAgent"/> |
247 | ++ </policy> |
248 | + <policy user="root"> |
249 | + <allow own="org.freedesktop.NetworkManager"/> |
250 | + <allow send_destination="org.freedesktop.NetworkManager"/> |
251 | diff --git a/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch |
252 | new file mode 100644 |
253 | index 0000000..88f9891 |
254 | --- /dev/null |
255 | +++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch |
256 | @@ -0,0 +1,38 @@ |
257 | +From: Tony Espy <espy@canonical.com> |
258 | +Date: Tue, 24 May 2016 21:36:20 -0400 |
259 | +Subject: Clear WiFi requested_scan if suppl exits |
260 | + |
261 | +It's possible for wpa_supplicant to exit with an |
262 | +outstanding requested_scan pending. This can lead |
263 | +to a stall condition where scanning no longer occurs. |
264 | +--- |
265 | + src/devices/wifi/nm-device-wifi.c | 9 ++++++++- |
266 | + 1 file changed, 8 insertions(+), 1 deletion(-) |
267 | + |
268 | +diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c |
269 | +index f6325a6..b147409 100644 |
270 | +--- a/src/devices/wifi/nm-device-wifi.c |
271 | ++++ b/src/devices/wifi/nm-device-wifi.c |
272 | +@@ -246,6 +246,13 @@ supplicant_interface_release (NMDeviceWifi *self) |
273 | + |
274 | + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); |
275 | + |
276 | ++ if (priv->requested_scan) { |
277 | ++ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): reset requested_scan flag to FALSE", |
278 | ++ nm_device_get_iface (NM_DEVICE (self))); |
279 | ++ priv->requested_scan = FALSE; |
280 | ++ nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE); |
281 | ++ } |
282 | ++ |
283 | + nm_clear_g_source (&priv->pending_scan_id); |
284 | + |
285 | + /* Reset the scan interval to be pretty frequent when disconnected */ |
286 | +@@ -1915,7 +1922,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface, |
287 | + priv->requested_scan = FALSE; |
288 | + } |
289 | + |
290 | +- cancel_pending_scan (self); |
291 | ++ nm_clear_g_source (&priv->pending_scan_id); |
292 | + request_wireless_scan (self, NULL); |
293 | + } |
294 | + default: |
295 | 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 |
296 | new file mode 100644 |
297 | index 0000000..d81b534 |
298 | --- /dev/null |
299 | +++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch |
300 | @@ -0,0 +1,37 @@ |
301 | +From: Tony Espy <espy@canonical.com> |
302 | +Date: Tue, 24 May 2016 21:22:48 -0400 |
303 | +Subject: Clear WiFi requested_scan if suppl goes INACTIVE |
304 | + |
305 | +It's possible for wpa_supplicant to transition to INACTIVE |
306 | +state with an outstanding requested_scan pending. This can |
307 | +lead to a stall condition where scanning no longer occurs. |
308 | +--- |
309 | + src/devices/wifi/nm-device-wifi.c | 15 +++++++++++++++ |
310 | + 1 file changed, 15 insertions(+) |
311 | + |
312 | +diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c |
313 | +index bacd5e6..f6325a6 100644 |
314 | +--- a/src/devices/wifi/nm-device-wifi.c |
315 | ++++ b/src/devices/wifi/nm-device-wifi.c |
316 | +@@ -1903,6 +1903,21 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface, |
317 | + else |
318 | + _LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up"); |
319 | + break; |
320 | ++ case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE: |
321 | ++ if (old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) { |
322 | ++ nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): supplicant state: SCANNING -> INACTIVE", |
323 | ++ nm_device_get_iface (NM_DEVICE (self))); |
324 | ++ |
325 | ++ if (priv->requested_scan) { |
326 | ++ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): clearing requested_scan", |
327 | ++ nm_device_get_iface (NM_DEVICE (self))); |
328 | ++ |
329 | ++ priv->requested_scan = FALSE; |
330 | ++ } |
331 | ++ |
332 | ++ cancel_pending_scan (self); |
333 | ++ request_wireless_scan (self, NULL); |
334 | ++ } |
335 | + default: |
336 | + break; |
337 | + } |
338 | 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 |
339 | index fae01f9..648dd6f 100644 |
340 | --- a/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch |
341 | +++ b/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch |
342 | @@ -3,6 +3,7 @@ Date: Fri, 13 May 2016 11:00:11 +0800 |
343 | Subject: Filter DNS servers to add to dnsmasq based on availability and VPN |
344 | status |
345 | |
346 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/898224 |
347 | --- |
348 | src/dns-manager/nm-dns-dnsmasq.c | 47 +++++++++++++++++++++++++++++++++------- |
349 | 1 file changed, 39 insertions(+), 8 deletions(-) |
350 | 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 |
351 | new file mode 100644 |
352 | index 0000000..9a538f0 |
353 | --- /dev/null |
354 | +++ b/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch |
355 | @@ -0,0 +1,32 @@ |
356 | +From: Tony Espy <espy@canonical.com> |
357 | +Date: Tue, 24 May 2016 21:41:18 -0400 |
358 | +Subject: Fix openvpn by handling do_add_route EEXISTS |
359 | + |
360 | +This patch fixes issues with the updated Netlink code in |
361 | +NMLinuxPlatform and ineroperability with older ( <= 3.10 ) |
362 | +kernels. |
363 | + |
364 | +Add EEXIST logic similar to logic found in 0.9.10 to the |
365 | +NMLinuxPlatform do_add_addroute(). |
366 | + |
367 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579222 |
368 | +--- |
369 | + src/platform/nm-linux-platform.c | 5 +++++ |
370 | + 1 file changed, 5 insertions(+) |
371 | + |
372 | +diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c |
373 | +index c504550..f453b6e 100644 |
374 | +--- a/src/platform/nm-linux-platform.c |
375 | ++++ b/src/platform/nm-linux-platform.c |
376 | +@@ -3915,6 +3915,11 @@ do_add_addrroute (NMPlatform *platform, const NMPObject *obj_id, struct nl_msg * |
377 | + obj = nmp_cache_lookup_obj (priv->cache, obj_id); |
378 | + } |
379 | + |
380 | ++ if (seq_result == -EEXIST) { |
381 | ++ _LOGI ("do_add_addroute: seq_restul == -EEXISTS; treating as OK"); |
382 | ++ seq_result = WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK; |
383 | ++ } |
384 | ++ |
385 | + /* Adding is only successful, if kernel reported success *and* we have the |
386 | + * expected object in cache afterwards. */ |
387 | + return obj && seq_result == WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK; |
388 | diff --git a/debian/patches/Ignore-p2p-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch |
389 | new file mode 100644 |
390 | index 0000000..c09e7d3 |
391 | --- /dev/null |
392 | +++ b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch |
393 | @@ -0,0 +1,34 @@ |
394 | +From: Tony Espy <espy@canonical.com> |
395 | +Date: Fri, 3 Jun 2016 15:50:53 -0400 |
396 | +Subject: Ignore p2p wifi devices from android |
397 | + |
398 | +This patch causes NMManager to ignore any p2p WiFi |
399 | +devices exposed by Android WiFi drivers. |
400 | + |
401 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1099983 |
402 | +--- |
403 | + src/nm-manager.c | 11 +++++++++++ |
404 | + 1 file changed, 11 insertions(+) |
405 | + |
406 | +diff --git a/src/nm-manager.c b/src/nm-manager.c |
407 | +index c2ed1da..8cf70c7 100644 |
408 | +--- a/src/nm-manager.c |
409 | ++++ b/src/nm-manager.c |
410 | +@@ -2097,6 +2097,17 @@ platform_link_added (NMManager *self, |
411 | + return; |
412 | + } |
413 | + |
414 | ++ /* |
415 | ++ * Ubuntu: Explicitly unmanage all p2p Wi-Fi devices which are |
416 | ++ * managed externally in the case of Wi-Fi Direct. |
417 | ++ */ |
418 | ++ NMDeviceType devtype = nm_device_get_device_type (device); |
419 | ++ if ((plink->type == NM_LINK_TYPE_WIFI) |
420 | ++ && g_strstr_len (plink->name, NM_STRLEN ("p2p"), "p2p")) { |
421 | ++ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name); |
422 | ++ return; |
423 | ++ } |
424 | ++ |
425 | + device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error); |
426 | + if (!device) { |
427 | + if (!ignore) { |
428 | diff --git a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch |
429 | deleted file mode 100644 |
430 | index c567c96..0000000 |
431 | --- a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch |
432 | +++ /dev/null |
433 | @@ -1,29 +0,0 @@ |
434 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
435 | -Date: Fri, 13 May 2016 11:08:30 +0800 |
436 | -Subject: Ignore p2p0 wifi devices from android. |
437 | - |
438 | ---- |
439 | - src/nm-manager.c | 10 ++++++++++ |
440 | - 1 file changed, 10 insertions(+) |
441 | - |
442 | -diff --git a/src/nm-manager.c b/src/nm-manager.c |
443 | -index 769662c..b770139 100644 |
444 | ---- a/src/nm-manager.c |
445 | -+++ b/src/nm-manager.c |
446 | -@@ -2105,6 +2105,16 @@ platform_link_added (NMManager *self, |
447 | - !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni"))) |
448 | - return; |
449 | - |
450 | -+ /* |
451 | -+ * Ubuntu: Explicitly unmanage p2p Wi-Fi devices exposed by Android JB Wi-Fi drivers. |
452 | -+ */ |
453 | -+ NMDeviceType devtype = nm_device_get_device_type (device); |
454 | -+ if ((plink->type == NM_LINK_TYPE_WIFI) |
455 | -+ && !strncmp (plink->name, "p2p0", NM_STRLEN ("p2p0"))) { |
456 | -+ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name); |
457 | -+ return; |
458 | -+ } |
459 | -+ |
460 | - if (device == NULL) { |
461 | - switch (plink->type) { |
462 | - case NM_LINK_TYPE_WWAN_ETHERNET: |
463 | diff --git a/debian/patches/Ignore-rild-modem-devices.patch b/debian/patches/Ignore-rild-modem-devices.patch |
464 | new file mode 100644 |
465 | index 0000000..c0cc6ae |
466 | --- /dev/null |
467 | +++ b/debian/patches/Ignore-rild-modem-devices.patch |
468 | @@ -0,0 +1,27 @@ |
469 | +From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
470 | +Date: Fri, 13 May 2016 11:08:17 +0800 |
471 | +Subject: Ignore rild modem devices. |
472 | + |
473 | +--- |
474 | + src/nm-manager.c | 8 ++++++++ |
475 | + 1 file changed, 8 insertions(+) |
476 | + |
477 | +diff --git a/src/nm-manager.c b/src/nm-manager.c |
478 | +index 10aa3d7..c2ed1da 100644 |
479 | +--- a/src/nm-manager.c |
480 | ++++ b/src/nm-manager.c |
481 | +@@ -2089,6 +2089,14 @@ platform_link_added (NMManager *self, |
482 | + gboolean ignore = FALSE; |
483 | + gs_free_error GError *error = NULL; |
484 | + |
485 | ++ /* Ignore rild modem devices, which will be handled by their modem parent */ |
486 | ++ if (g_strstr_len (plink->name, NM_STRLEN ("rmnet"), "rmnet") || |
487 | ++ g_strstr_len (plink->name, NM_STRLEN ("rev_rmnet"), "rev_rmnet") || |
488 | ++ g_strstr_len (plink->name, NM_STRLEN ("ccmni"), "ccmni")) { |
489 | ++ _LOGW (LOGD_HW, "Ignoring rild modem device: %s", plink->name); |
490 | ++ return; |
491 | ++ } |
492 | ++ |
493 | + device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error); |
494 | + if (!device) { |
495 | + if (!ignore) { |
496 | diff --git a/debian/patches/Ignore-rmnet_usbX-devices.patch b/debian/patches/Ignore-rmnet_usbX-devices.patch |
497 | deleted file mode 100644 |
498 | index f973a5f..0000000 |
499 | --- a/debian/patches/Ignore-rmnet_usbX-devices.patch |
500 | +++ /dev/null |
501 | @@ -1,25 +0,0 @@ |
502 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
503 | -Date: Fri, 13 May 2016 11:08:17 +0800 |
504 | -Subject: Ignore rmnet_usbX devices. |
505 | - |
506 | ---- |
507 | - src/nm-manager.c | 6 ++++++ |
508 | - 1 file changed, 6 insertions(+) |
509 | - |
510 | -diff --git a/src/nm-manager.c b/src/nm-manager.c |
511 | -index 10aa3d7..769662c 100644 |
512 | ---- a/src/nm-manager.c |
513 | -+++ b/src/nm-manager.c |
514 | -@@ -2099,6 +2099,12 @@ platform_link_added (NMManager *self, |
515 | - } |
516 | - } |
517 | - |
518 | -+ /* Ignore rmnet_usb devices, which will be handled by their modem parent |
519 | -+ */ |
520 | -+ if (!strncmp (plink->name, "rmnet_usb", NM_STRLEN ("rmnet_usb")) || |
521 | -+ !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni"))) |
522 | -+ return; |
523 | -+ |
524 | - if (device == NULL) { |
525 | - switch (plink->type) { |
526 | - case NM_LINK_TYPE_WWAN_ETHERNET: |
527 | diff --git a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch |
528 | index 1630362..6f5a018 100644 |
529 | --- a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch |
530 | +++ b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch |
531 | @@ -9,16 +9,16 @@ meaning the device is in such a state that it can be activated. |
532 | This change prevents NM from trying to activate a modem which |
533 | is not yet ready to be activated. |
534 | |
535 | -Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1445080 |
536 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1445080 |
537 | --- |
538 | src/devices/wwan/nm-device-modem.c | 7 ++++--- |
539 | 1 file changed, 4 insertions(+), 3 deletions(-) |
540 | |
541 | diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c |
542 | -index a7523f5..774fd24 100644 |
543 | +index 39a34db..3bbd170 100644 |
544 | --- a/src/devices/wwan/nm-device-modem.c |
545 | +++ b/src/devices/wwan/nm-device-modem.c |
546 | -@@ -428,14 +428,15 @@ check_connection_available (NMDevice *device, |
547 | +@@ -410,14 +410,15 @@ check_connection_available (NMDevice *device, |
548 | return FALSE; |
549 | |
550 | state = nm_modem_get_state (priv->modem); |
551 | @@ -36,7 +36,7 @@ index a7523f5..774fd24 100644 |
552 | return TRUE; |
553 | } |
554 | |
555 | -@@ -616,7 +617,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags) |
556 | +@@ -598,7 +599,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags) |
557 | |
558 | g_assert (priv->modem); |
559 | modem_state = nm_modem_get_state (priv->modem); |
560 | 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 |
561 | index 83d8940..0d67e33 100644 |
562 | --- a/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch |
563 | +++ b/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch |
564 | @@ -13,6 +13,8 @@ This is a very simple implementation of such re-ordering, just add the IPv6 |
565 | nameservers first when building the list of IP configurations (which will |
566 | include nameservers, search domains, etc.), the IPv4 data will be appended |
567 | right after. |
568 | + |
569 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/936712 |
570 | --- |
571 | src/dns-manager/nm-dns-manager.c | 8 ++++---- |
572 | 1 file changed, 4 insertions(+), 4 deletions(-) |
573 | diff --git a/debian/patches/Set-the-default-powersave-value-to-enabled.patch b/debian/patches/Set-the-default-powersave-value-to-enabled.patch |
574 | deleted file mode 100644 |
575 | index 7449719..0000000 |
576 | --- a/debian/patches/Set-the-default-powersave-value-to-enabled.patch |
577 | +++ /dev/null |
578 | @@ -1,51 +0,0 @@ |
579 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
580 | -Date: Fri, 13 May 2016 11:08:10 +0800 |
581 | -Subject: Set the default powersave value to enabled |
582 | - |
583 | -This is an Ubuntu-specific patch to enable wireless powersave by default. |
584 | - |
585 | -Should it not work for you for some reason, you can safely add: |
586 | - |
587 | -powersave=0 |
588 | - |
589 | -to the section: |
590 | -[802-11-wireless] |
591 | - |
592 | -In the configuration file for your connection under |
593 | -/etc/NetworkManager/system-connections/. |
594 | ---- |
595 | - libnm-util/nm-setting-wireless.c | 7 +++++-- |
596 | - 1 file changed, 5 insertions(+), 2 deletions(-) |
597 | - |
598 | -diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c |
599 | -index 234d7ba..613539d 100644 |
600 | ---- a/libnm-util/nm-setting-wireless.c |
601 | -+++ b/libnm-util/nm-setting-wireless.c |
602 | -@@ -675,7 +675,7 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting) |
603 | - guint32 |
604 | - nm_setting_wireless_get_powersave (NMSettingWireless *setting) |
605 | - { |
606 | -- g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); |
607 | -+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 1); |
608 | - |
609 | - return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave; |
610 | - } |
611 | -@@ -885,6 +885,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) |
612 | - static void |
613 | - nm_setting_wireless_init (NMSettingWireless *setting) |
614 | - { |
615 | -+ NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting); |
616 | -+ |
617 | -+ priv->powersave = 1; |
618 | - } |
619 | - |
620 | - static void |
621 | -@@ -1283,7 +1286,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class) |
622 | - g_object_class_install_property |
623 | - (object_class, PROP_POWERSAVE, |
624 | - g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "", |
625 | -- 0, G_MAXUINT32, 0, |
626 | -+ 0, G_MAXUINT32, 1, |
627 | - G_PARAM_READWRITE | |
628 | - G_PARAM_STATIC_STRINGS)); |
629 | - } |
630 | diff --git a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch |
631 | index 45b668e..f96673b 100644 |
632 | --- a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch |
633 | +++ b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch |
634 | @@ -79,7 +79,7 @@ index 2495bbc..49028f1 100644 |
635 | if SUSPEND_RESUME_UPOWER |
636 | libNetworkManager_la_SOURCES += nm-sleep-monitor-upower.c |
637 | diff --git a/src/nm-manager.c b/src/nm-manager.c |
638 | -index b770139..04b0a43 100644 |
639 | +index 8cf70c7..8f45b0f 100644 |
640 | --- a/src/nm-manager.c |
641 | +++ b/src/nm-manager.c |
642 | @@ -34,6 +34,7 @@ |
643 | @@ -108,7 +108,7 @@ index b770139..04b0a43 100644 |
644 | |
645 | gboolean startup; |
646 | gboolean devices_inited; |
647 | -@@ -5210,6 +5215,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr, |
648 | +@@ -5213,6 +5218,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr, |
649 | |
650 | /**********************************************************************/ |
651 | |
652 | @@ -158,7 +158,7 @@ index b770139..04b0a43 100644 |
653 | NM_DEFINE_SINGLETON_REGISTER (NMManager); |
654 | |
655 | NMManager * |
656 | -@@ -5231,6 +5279,44 @@ nm_connection_provider_get (void) |
657 | +@@ -5234,6 +5282,44 @@ nm_connection_provider_get (void) |
658 | return p; |
659 | } |
660 | |
661 | @@ -203,7 +203,7 @@ index b770139..04b0a43 100644 |
662 | NMManager * |
663 | nm_manager_setup (const char *state_file, |
664 | gboolean initial_net_enabled, |
665 | -@@ -5311,16 +5397,38 @@ constructed (GObject *object) |
666 | +@@ -5314,16 +5400,38 @@ constructed (GObject *object) |
667 | "rfkill-changed", |
668 | G_CALLBACK (rfkill_manager_rfkill_changed_cb), |
669 | self); |
670 | diff --git a/debian/patches/Update-dnsmasq-parameters.patch b/debian/patches/Update-dnsmasq-parameters.patch |
671 | index 20d8f91..3b83b82 100644 |
672 | --- a/debian/patches/Update-dnsmasq-parameters.patch |
673 | +++ b/debian/patches/Update-dnsmasq-parameters.patch |
674 | @@ -6,7 +6,7 @@ Disable caching since it's a potential security issue (local dns cache poisoning |
675 | |
676 | See also: https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving |
677 | |
678 | -=== modified file 'src/dns-manager/nm-dns-dnsmasq.c' |
679 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/903854 |
680 | --- |
681 | src/dns-manager/nm-dns-dnsmasq.c | 4 ++-- |
682 | src/dns-manager/nm-dns-manager.c | 6 +++--- |
683 | diff --git a/debian/patches/series b/debian/patches/series |
684 | index f0a8f73..421ffe9 100644 |
685 | --- a/debian/patches/series |
686 | +++ b/debian/patches/series |
687 | @@ -12,13 +12,18 @@ Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch |
688 | Revert-wifi-disable-Ad-Hoc-WPA-connections-lp-905748.patch |
689 | Replace-Ad-Hoc-WPA-None-support-with-IBSS-RSN-PSK.patch |
690 | wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch |
691 | -Set-the-default-powersave-value-to-enabled.patch |
692 | -Ignore-rmnet_usbX-devices.patch |
693 | -Ignore-p2p0-wifi-devices-from-android.patch |
694 | +Ignore-rild-modem-devices.patch |
695 | +Ignore-p2p-wifi-devices-from-android.patch |
696 | wwan-add-support-for-using-oFono-as-a-modem-manager.patch |
697 | Add-new-NMSettingsConnection-reset_retries-get-set-m.patch |
698 | Let-NetworkManager-read-oFono-settings-file-and-crea.patch |
699 | +Add-modem-reconnect-delay-to-policy.patch |
700 | Modify-NMDeviceModem-s-available-logic.patch |
701 | Track-killswitch-change-signals-from-urfkill.patch |
702 | Only-test-team-devices-if-we-built-support-for-them.patch |
703 | Disable-general-with-expect-which-tends-to-fail-on-p.patch |
704 | +Add-sudo-policy-to-DBus-conf-for-indicator-network.patch |
705 | +Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch |
706 | +Clear-WiFi-requested_scan-if-suppl-exits.patch |
707 | +Fix-openvpn-by-handling-do_add_route-EEXISTS.patch |
708 | +wwan-fix-ofono-connection-problems.patch |
709 | 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 |
710 | index cd18c65..377ec85 100644 |
711 | --- a/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch |
712 | +++ b/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch |
713 | @@ -8,13 +8,13 @@ Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
714 | --- |
715 | configure.ac | 9 + |
716 | src/devices/wwan/Makefile.am | 7 + |
717 | - src/devices/wwan/nm-device-modem.c | 20 + |
718 | - src/devices/wwan/nm-modem-manager.c | 220 +++++- |
719 | - src/devices/wwan/nm-modem-ofono.c | 1449 +++++++++++++++++++++++++++++++++++ |
720 | + src/devices/wwan/nm-device-modem.c | 2 + |
721 | + src/devices/wwan/nm-modem-manager.c | 241 +++++- |
722 | + src/devices/wwan/nm-modem-ofono.c | 1436 +++++++++++++++++++++++++++++++++++ |
723 | src/devices/wwan/nm-modem-ofono.h | 64 ++ |
724 | src/devices/wwan/nm-modem.c | 8 +- |
725 | src/nm-core-utils.c | 20 +- |
726 | - 8 files changed, 1787 insertions(+), 10 deletions(-) |
727 | + 8 files changed, 1766 insertions(+), 21 deletions(-) |
728 | create mode 100644 src/devices/wwan/nm-modem-ofono.c |
729 | create mode 100644 src/devices/wwan/nm-modem-ofono.h |
730 | |
731 | @@ -57,7 +57,7 @@ index 1777eb3..65d9952 100644 |
732 | |
733 | libnm_wwan_la_LDFLAGS = \ |
734 | diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c |
735 | -index a8361c4..a7523f5 100644 |
736 | +index a8361c4..39a34db 100644 |
737 | --- a/src/devices/wwan/nm-device-modem.c |
738 | +++ b/src/devices/wwan/nm-device-modem.c |
739 | @@ -100,6 +100,7 @@ modem_prepare_result (NMModem *modem, |
740 | @@ -68,39 +68,7 @@ index a8361c4..a7523f5 100644 |
741 | if (reason == NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT) { |
742 | /* If the connect failed because the SIM PIN was wrong don't allow |
743 | * the device to be auto-activated anymore, which would risk locking |
744 | -@@ -282,6 +283,16 @@ modem_state_cb (NMModem *modem, |
745 | - } |
746 | - } |
747 | - |
748 | -+ if (dev_state >= NM_DEVICE_STATE_DISCONNECTED && |
749 | -+ new_state == NM_MODEM_STATE_REGISTERED && old_state < NM_MODEM_STATE_REGISTERED) { |
750 | -+ |
751 | -+ nm_log_info (LOGD_MB, "(%s): modem re-registered; re-checking autoconnect", |
752 | -+ nm_device_get_iface (device)); |
753 | -+ |
754 | -+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL); |
755 | -+ nm_device_emit_recheck_auto_activate (device); |
756 | -+ } |
757 | -+ |
758 | - if (new_state < NM_MODEM_STATE_CONNECTING && |
759 | - old_state >= NM_MODEM_STATE_CONNECTING && |
760 | - dev_state >= NM_DEVICE_STATE_NEED_AUTH && |
761 | -@@ -345,6 +356,14 @@ device_state_changed (NMDevice *device, |
762 | - nm_modem_state_to_string (nm_modem_get_state (priv->modem))); |
763 | - } |
764 | - |
765 | -+ /* Block autoconnect until the modem is registered again */ |
766 | -+ if (new_state == NM_DEVICE_STATE_FAILED && nm_modem_get_state (priv->modem) == NM_MODEM_STATE_SEARCHING) { |
767 | -+ nm_log_info (LOGD_MB, "(%s): modem searching; disabling autoconnect", |
768 | -+ nm_device_get_iface (device)); |
769 | -+ |
770 | -+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL); |
771 | -+ } |
772 | -+ |
773 | - nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); |
774 | - |
775 | - switch (reason) { |
776 | -@@ -545,6 +564,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid) |
777 | +@@ -545,6 +546,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid) |
778 | |
779 | g_return_val_if_fail (priv->modem, FALSE); |
780 | success = nm_modem_get_iid (priv->modem, out_iid); |
781 | @@ -109,7 +77,7 @@ index a8361c4..a7523f5 100644 |
782 | success = NM_DEVICE_CLASS (nm_device_modem_parent_class)->get_ip_iface_identifier (device, out_iid); |
783 | return success; |
784 | diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c |
785 | -index 9e9bc13..0d1ec78 100644 |
786 | +index 9e9bc13..cd97b87 100644 |
787 | --- a/src/devices/wwan/nm-modem-manager.c |
788 | +++ b/src/devices/wwan/nm-modem-manager.c |
789 | @@ -17,7 +17,7 @@ |
790 | @@ -251,7 +219,7 @@ index 9e9bc13..0d1ec78 100644 |
791 | +{ |
792 | + gchar *name_owner; |
793 | + |
794 | -+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (self->priv->ofono_proxy)); |
795 | ++ name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (self->priv->ofono_proxy)); |
796 | + if (name_owner) { |
797 | + /* Available! */ |
798 | + ofono_appeared (self); |
799 | @@ -324,7 +292,37 @@ index 9e9bc13..0d1ec78 100644 |
800 | |
801 | static void |
802 | modem_manager_poke_cb (GDBusConnection *connection, |
803 | -@@ -336,22 +518,44 @@ manager_new_ready (GObject *source, |
804 | +@@ -233,19 +415,18 @@ modem_manager_poke_cb (GDBusConnection *connection, |
805 | + |
806 | + result = g_dbus_connection_call_finish (connection, res, &error); |
807 | + if (error) { |
808 | +- /* Ignore common errors when MM is not installed and such */ |
809 | +- if ( !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN) |
810 | +- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_EXEC_FAILED) |
811 | +- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FORK_FAILED) |
812 | +- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FAILED) |
813 | +- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_TIMEOUT) |
814 | +- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) { |
815 | +- nm_log_dbg (LOGD_MB, "error poking ModemManager: %s", error->message); |
816 | ++ nm_log_warn (LOGD_MB, "error poking ModemManager: %s", |
817 | ++ error ? error->message : ""); |
818 | ++ |
819 | ++ /* Don't reschedule poke is MM service doesn't exist. */ |
820 | ++ if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN) |
821 | ++ && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) { |
822 | ++ |
823 | ++ /* Setup timeout to relaunch */ |
824 | ++ schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL); |
825 | + } |
826 | +- g_error_free (error); |
827 | + |
828 | +- /* Setup timeout to relaunch */ |
829 | +- schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL); |
830 | ++ g_error_free (error); |
831 | + } else |
832 | + g_variant_unref (result); |
833 | + |
834 | +@@ -336,22 +517,44 @@ manager_new_ready (GObject *source, |
835 | static void |
836 | ensure_client (NMModemManager *self) |
837 | { |
838 | @@ -373,7 +371,7 @@ index 9e9bc13..0d1ec78 100644 |
839 | } |
840 | |
841 | static void |
842 | -@@ -430,6 +634,12 @@ dispose (GObject *object) |
843 | +@@ -430,6 +633,12 @@ dispose (GObject *object) |
844 | |
845 | modem_manager_clear_signals (self); |
846 | g_clear_object (&self->priv->modem_manager); |
847 | @@ -388,10 +386,10 @@ index 9e9bc13..0d1ec78 100644 |
848 | if (self->priv->modems) { |
849 | diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c |
850 | new file mode 100644 |
851 | -index 0000000..162b88d |
852 | +index 0000000..4566be0 |
853 | --- /dev/null |
854 | +++ b/src/devices/wwan/nm-modem-ofono.c |
855 | -@@ -0,0 +1,1449 @@ |
856 | +@@ -0,0 +1,1436 @@ |
857 | +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
858 | +/* NetworkManager -- Network link manager |
859 | + * |
860 | @@ -604,12 +602,7 @@ index 0000000..162b88d |
861 | + nm_log_dbg (LOGD_MB, "(%s): modem disconnected", |
862 | + nm_modem_get_uid (NM_MODEM (self))); |
863 | + |
864 | -+ /* NOTES(1.2): This doesn't accomplish anything as none of the attributes that |
865 | -+ * are checked by update_modem_state are changed by this function! |
866 | -+ * |
867 | -+ * update_modem_state (self); |
868 | -+ */ |
869 | -+ |
870 | ++ update_modem_state (self); |
871 | + disconnect_context_complete (ctx); |
872 | +} |
873 | + |
874 | @@ -784,7 +777,7 @@ index 0000000..162b88d |
875 | + &error); |
876 | + if (!v_properties) { |
877 | + g_dbus_error_strip_remote_error (error); |
878 | -+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: %s", |
879 | ++ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: %s", |
880 | + nm_modem_get_uid (NM_MODEM (self)), |
881 | + error->message); |
882 | + g_error_free (error); |
883 | @@ -795,7 +788,7 @@ index 0000000..162b88d |
884 | + |
885 | + v_dict = g_variant_get_child_value (v_properties, 0); |
886 | + if (!v_dict) { |
887 | -+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: no v_dict", |
888 | ++ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: no v_dict", |
889 | + nm_modem_get_uid (NM_MODEM (self))); |
890 | + return; |
891 | + } |
892 | @@ -897,7 +890,7 @@ index 0000000..162b88d |
893 | + gboolean attached = g_variant_get_boolean (v); |
894 | + |
895 | + nm_log_dbg (LOGD_MB, "(%s): Attached: %s", |
896 | -+ nm_modem_get_uid (NM_MODEM (self)), property ? "True" : "False"); |
897 | ++ nm_modem_get_uid (NM_MODEM (self)), attached ? "True" : "False"); |
898 | + |
899 | + if (priv->gprs_attached != attached) { |
900 | + priv->gprs_attached = attached; |
901 | @@ -941,7 +934,7 @@ index 0000000..162b88d |
902 | + &error); |
903 | + if (!v_properties) { |
904 | + g_dbus_error_strip_remote_error (error); |
905 | -+ nm_log_warn (LOGD_BT, "(%s) error getting connman properties: %s", |
906 | ++ nm_log_warn (LOGD_MB, "(%s) error getting connman properties: %s", |
907 | + nm_modem_get_uid (NM_MODEM (self)), |
908 | + error->message); |
909 | + g_error_free (error); |
910 | @@ -1121,7 +1114,7 @@ index 0000000..162b88d |
911 | + &error); |
912 | + if (!v_properties) { |
913 | + g_dbus_error_strip_remote_error (error); |
914 | -+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: %s", |
915 | ++ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: %s", |
916 | + nm_modem_get_uid (NM_MODEM (self)), |
917 | + error->message); |
918 | + g_error_free (error); |
919 | @@ -1130,7 +1123,7 @@ index 0000000..162b88d |
920 | + |
921 | + v_dict = g_variant_get_child_value (v_properties, 0); |
922 | + if (!v_dict) { |
923 | -+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: no v_dict", |
924 | ++ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: no v_dict", |
925 | + nm_modem_get_uid (NM_MODEM (self))); |
926 | + return; |
927 | + } |
928 | @@ -1226,14 +1219,6 @@ index 0000000..162b88d |
929 | + nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property); |
930 | + |
931 | + /* |
932 | -+ * 0.9.10.x: |
933 | -+ * |
934 | -+ * The old code got PropertyChanged for Settings, and then immediately |
935 | -+ * called 'GetProperties' to get the current values of 'Settings'. |
936 | -+ * |
937 | -+ * There's no need to do this, as the PropertyChanged has the value of |
938 | -+ * 'Settings' as its payload!!! |
939 | -+ * |
940 | + * TODO: might be a good idea and re-factor this to mimic bluez-device, |
941 | + * ie. have this function just check the key, and call a sub-func to |
942 | + * handle the action. |
943 | @@ -1242,24 +1227,14 @@ index 0000000..162b88d |
944 | + if (g_strcmp0 (property, "Settings") != 0) |
945 | + return; |
946 | + |
947 | -+ nm_log_dbg (LOGD_MB, "found 'Settings' DICTIONARY property"); |
948 | -+ |
949 | -+ if (nm_modem_get_state (NM_MODEM (self)) == NM_MODEM_STATE_CONNECTED && g_variant_n_children (v) <= 0) { |
950 | -+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings empty", nm_modem_get_uid (NM_MODEM (self))); |
951 | -+ |
952 | -+ goto out; |
953 | -+ } |
954 | -+ |
955 | -+ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static configuration:", nm_modem_get_uid (NM_MODEM (self))); |
956 | -+ |
957 | + v_dict = g_variant_get_child_value (v, 0); |
958 | + if (!v_dict) { |
959 | -+ nm_log_warn (LOGD_BT, "ofono: (%s): error getting IPv4 Settings: no v_dict", |
960 | ++ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings", |
961 | + nm_modem_get_uid (NM_MODEM (self))); |
962 | -+ return; |
963 | ++ goto out; |
964 | + } |
965 | + |
966 | -+ /* NOTE - 0.9.10x code didn't fail if 'Interface' missing */ |
967 | ++ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self))); |
968 | + |
969 | + if (g_variant_lookup (v_dict, "Interface", "&s", &s)) { |
970 | + |
971 | @@ -1271,7 +1246,7 @@ index 0000000..162b88d |
972 | + NM_MODEM_IP4_METHOD, NM_MODEM_IP_METHOD_STATIC, |
973 | + NULL); |
974 | + } else { |
975 | -+ nm_log_warn (LOGD_BT, "ofono: (%s): Settings 'Interface'; empty", |
976 | ++ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Interface'; empty", |
977 | + nm_modem_get_uid (NM_MODEM (self))); |
978 | + goto out; |
979 | + } |
980 | @@ -1323,6 +1298,7 @@ index 0000000..162b88d |
981 | + } else { |
982 | + nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Address' missing", |
983 | + nm_modem_get_uid (NM_MODEM (self))); |
984 | ++ goto out; |
985 | + } |
986 | + |
987 | + if (g_variant_lookup (v_dict, "Netmask", "&s", &s)) { |
988 | @@ -1345,7 +1321,9 @@ index 0000000..162b88d |
989 | + goto out; |
990 | + } |
991 | + |
992 | -+ nm_log_info (LOGD_MB, " address %s/%d", addr_s, prefix); |
993 | ++ nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d", |
994 | ++ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix); |
995 | ++ |
996 | + nm_ip4_config_add_address (priv->ip4_config, &addr); |
997 | + |
998 | + if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) { |
999 | @@ -1372,7 +1350,7 @@ index 0000000..162b88d |
1000 | + |
1001 | + while (*iter) { |
1002 | + if (ip_string_to_network_address (*iter, &address_network) && address_network > 0) { |
1003 | -+ nm_log_info (LOGD_MB, "ofono: (%s): DNS %s", |
1004 | ++ nm_log_info (LOGD_MB, "ofono: (%s): DNS: %s", |
1005 | + nm_modem_get_uid (NM_MODEM (self)), *iter); |
1006 | + |
1007 | + nm_ip4_config_add_nameserver (priv->ip4_config, address_network); |
1008 | @@ -1384,13 +1362,15 @@ index 0000000..162b88d |
1009 | + *iter++; |
1010 | + } |
1011 | + |
1012 | -+ /* TOOD: check for minimum NameServers >= 1? */ |
1013 | ++ if (iter == array) { |
1014 | ++ nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified", |
1015 | ++ nm_modem_get_uid (NM_MODEM (self))); |
1016 | ++ g_free (array); |
1017 | ++ goto out; |
1018 | ++ } |
1019 | + |
1020 | + g_free (array); |
1021 | + } else { |
1022 | -+ |
1023 | -+ /* NOTE - 0.9.10.x would not throw an error in this case!!! */ |
1024 | -+ |
1025 | + nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'DomainNameServers' missing", |
1026 | + nm_modem_get_uid (NM_MODEM (self))); |
1027 | + goto out; |
1028 | @@ -1419,14 +1399,19 @@ index 0000000..162b88d |
1029 | + ret = TRUE; |
1030 | + |
1031 | +out: |
1032 | -+ if (!ret) |
1033 | -+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; |
1034 | ++ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) { |
1035 | ++ nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s", |
1036 | ++ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE"); |
1037 | + |
1038 | -+ nm_log_dbg (LOGD_MB, "(%s): DONE w/Settings; ret: %s", |
1039 | -+ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE"); |
1040 | ++ if (!ret) |
1041 | ++ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; |
1042 | + |
1043 | -+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) |
1044 | + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, ret, reason); |
1045 | ++ } else { |
1046 | ++ nm_log_warn (LOGD_MB, "ofono: (%s): MODEM_PPP_FAILED", nm_modem_get_uid (NM_MODEM (self))); |
1047 | ++ |
1048 | ++ g_signal_emit_by_name (self, NM_MODEM_PPP_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED); |
1049 | ++ } |
1050 | +} |
1051 | + |
1052 | +static NMActStageReturn |
1053 | diff --git a/debian/patches/wwan-fix-ofono-connection-problems.patch b/debian/patches/wwan-fix-ofono-connection-problems.patch |
1054 | new file mode 100644 |
1055 | index 0000000..bff500d |
1056 | --- /dev/null |
1057 | +++ b/debian/patches/wwan-fix-ofono-connection-problems.patch |
1058 | @@ -0,0 +1,343 @@ |
1059 | +From: Tony Espy <espy@canonical.com> |
1060 | +Date: Fri, 3 Jun 2016 18:03:32 -0400 |
1061 | +Subject: Fix ofono connection problems |
1062 | + |
1063 | +This patch fixes three (re) connection problems with |
1064 | +the ofono plugin: |
1065 | + |
1066 | +1) If the modem is connected, and registrations drops, |
1067 | +and then is restored, the connection isn't re-activated. |
1068 | +The fix was simply to change modem_state_cb to not return |
1069 | +after setting the state to failed, which allows nm_device_ |
1070 | +queue_recheck_available to be called, which queues a state |
1071 | +transition to UNAVAILABLE. |
1072 | + |
1073 | +2) If ofono returns InProgress, don't treat as a PREPARE_FAILURE. |
1074 | + |
1075 | +3) If the ofono conext is already active, use it's existing |
1076 | +'Settings' property to configure the device. |
1077 | + |
1078 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1565717 |
1079 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579098 |
1080 | +--- |
1081 | + src/devices/wwan/nm-device-modem.c | 4 +- |
1082 | + src/devices/wwan/nm-modem-ofono.c | 193 +++++++++++++++++++++++++++---------- |
1083 | + src/devices/wwan/nm-modem-ofono.h | 2 + |
1084 | + 3 files changed, 145 insertions(+), 54 deletions(-) |
1085 | + |
1086 | +diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c |
1087 | +index 3bbd170..22009f8 100644 |
1088 | +--- a/src/devices/wwan/nm-device-modem.c |
1089 | ++++ b/src/devices/wwan/nm-device-modem.c |
1090 | +@@ -286,12 +286,10 @@ modem_state_cb (NMModem *modem, |
1091 | + if (new_state < NM_MODEM_STATE_CONNECTING && |
1092 | + old_state >= NM_MODEM_STATE_CONNECTING && |
1093 | + dev_state >= NM_DEVICE_STATE_NEED_AUTH && |
1094 | +- dev_state <= NM_DEVICE_STATE_ACTIVATED) { |
1095 | ++ dev_state <= NM_DEVICE_STATE_ACTIVATED) |
1096 | + /* Fail the device if the modem disconnects unexpectedly while the |
1097 | + * device is activating/activated. */ |
1098 | + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER); |
1099 | +- return; |
1100 | +- } |
1101 | + |
1102 | + if (new_state > NM_MODEM_STATE_LOCKED && old_state == NM_MODEM_STATE_LOCKED) { |
1103 | + /* If the modem is now unlocked, enable/disable it according to the |
1104 | +diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c |
1105 | +index 4566be0..c09cfd5 100644 |
1106 | +--- a/src/devices/wwan/nm-modem-ofono.c |
1107 | ++++ b/src/devices/wwan/nm-modem-ofono.c |
1108 | +@@ -789,42 +789,35 @@ stage1_prepare_done (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data |
1109 | + g_dbus_proxy_call_finish (proxy, result, &error); |
1110 | + |
1111 | + if (error) { |
1112 | +- nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s", |
1113 | +- error ? error->code : -1, |
1114 | +- error && error->message ? error->message : "(unknown)"); |
1115 | ++ if (!g_strstr_len (error->message, NM_STRLEN (OFONO_ERROR_IN_PROGRESS), OFONO_ERROR_IN_PROGRESS)) { |
1116 | ++ nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s", |
1117 | ++ error ? error->code : -1, |
1118 | ++ error && error->message ? error->message : "(unknown)"); |
1119 | + |
1120 | +- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
1121 | +- NM_DEVICE_STATE_REASON_MODEM_BUSY); |
1122 | +- /* |
1123 | +- * FIXME: add code to check for InProgress so that the |
1124 | +- * connection doesn't continue to try and activate, |
1125 | +- * leading to the connection being disabled, and a 5m |
1126 | +- * timeout... |
1127 | +- */ |
1128 | ++ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
1129 | ++ NM_DEVICE_STATE_REASON_MODEM_BUSY); |
1130 | ++ } else |
1131 | ++ nm_log_warn (LOGD_MB, "ofono: connection activation returned Error.InProgress"); |
1132 | + |
1133 | + g_clear_error (&error); |
1134 | + } |
1135 | + } |
1136 | + |
1137 | + static void |
1138 | +-context_property_changed (GDBusProxy *proxy, |
1139 | +- const char *property, |
1140 | +- GVariant *v, |
1141 | +- gpointer user_data) |
1142 | ++handle_settings (GVariant *v_dict, gpointer user_data) |
1143 | + { |
1144 | + NMModemOfono *self = NM_MODEM_OFONO (user_data); |
1145 | + NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
1146 | + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; |
1147 | + NMPlatformIP4Address addr; |
1148 | + gboolean ret = FALSE; |
1149 | +- GVariant *v_dict; |
1150 | + GVariantIter i; |
1151 | + const gchar *s, *addr_s; |
1152 | + const gchar **array, **iter; |
1153 | + guint32 address_network, gateway_network; |
1154 | + guint prefix = 0; |
1155 | + |
1156 | +- nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property); |
1157 | ++ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self))); |
1158 | + |
1159 | + /* |
1160 | + * TODO: might be a good idea and re-factor this to mimic bluez-device, |
1161 | +@@ -832,18 +825,6 @@ context_property_changed (GDBusProxy *proxy, |
1162 | + * handle the action. |
1163 | + */ |
1164 | + |
1165 | +- if (g_strcmp0 (property, "Settings") != 0) |
1166 | +- return; |
1167 | +- |
1168 | +- v_dict = g_variant_get_child_value (v, 0); |
1169 | +- if (!v_dict) { |
1170 | +- nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings", |
1171 | +- nm_modem_get_uid (NM_MODEM (self))); |
1172 | +- goto out; |
1173 | +- } |
1174 | +- |
1175 | +- nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self))); |
1176 | +- |
1177 | + if (g_variant_lookup (v_dict, "Interface", "&s", &s)) { |
1178 | + |
1179 | + nm_log_dbg (LOGD_MB, "(%s): Interface: %s", nm_modem_get_uid (NM_MODEM (self)), s); |
1180 | +@@ -930,8 +911,7 @@ context_property_changed (GDBusProxy *proxy, |
1181 | + } |
1182 | + |
1183 | + nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d", |
1184 | +- nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix); |
1185 | +- |
1186 | ++ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix); |
1187 | + nm_ip4_config_add_address (priv->ip4_config, &addr); |
1188 | + |
1189 | + if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) { |
1190 | +@@ -972,7 +952,7 @@ context_property_changed (GDBusProxy *proxy, |
1191 | + |
1192 | + if (iter == array) { |
1193 | + nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified", |
1194 | +- nm_modem_get_uid (NM_MODEM (self))); |
1195 | ++ nm_modem_get_uid (NM_MODEM (self))); |
1196 | + g_free (array); |
1197 | + goto out; |
1198 | + } |
1199 | +@@ -1009,7 +989,7 @@ context_property_changed (GDBusProxy *proxy, |
1200 | + out: |
1201 | + if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) { |
1202 | + nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s", |
1203 | +- nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE"); |
1204 | ++ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE"); |
1205 | + |
1206 | + if (!ret) |
1207 | + reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; |
1208 | +@@ -1022,6 +1002,33 @@ out: |
1209 | + } |
1210 | + } |
1211 | + |
1212 | ++static void |
1213 | ++context_property_changed (GDBusProxy *proxy, |
1214 | ++ const char *property, |
1215 | ++ GVariant *v, |
1216 | ++ gpointer user_data) |
1217 | ++{ |
1218 | ++ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
1219 | ++ GVariant *v_dict; |
1220 | ++ |
1221 | ++ nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property); |
1222 | ++ |
1223 | ++ if (g_strcmp0 (property, "Settings") != 0) |
1224 | ++ return; |
1225 | ++ |
1226 | ++ v_dict = g_variant_get_child_value (v, 0); |
1227 | ++ if (!v_dict) { |
1228 | ++ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings", |
1229 | ++ nm_modem_get_uid (NM_MODEM (self))); |
1230 | ++ return; |
1231 | ++ } |
1232 | ++ |
1233 | ++ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT)); |
1234 | ++ |
1235 | ++ handle_settings (v_dict, user_data); |
1236 | ++ g_variant_unref (v_dict); |
1237 | ++} |
1238 | ++ |
1239 | + static NMActStageReturn |
1240 | + static_stage3_ip4_config_start (NMModem *_self, |
1241 | + NMActRequest *req, |
1242 | +@@ -1053,11 +1060,100 @@ static_stage3_ip4_config_start (NMModem *_self, |
1243 | + } |
1244 | + |
1245 | + static void |
1246 | ++context_properties_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data) |
1247 | ++{ |
1248 | ++ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
1249 | ++ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
1250 | ++ GError *error = NULL; |
1251 | ++ GVariant *properties, *settings; |
1252 | ++ GVariant *v_dict = NULL; |
1253 | ++ gboolean active; |
1254 | ++ |
1255 | ++ nm_log_dbg (LOGD_MB, "in %s", __func__); |
1256 | ++ |
1257 | ++ properties = g_dbus_proxy_call_finish (proxy, result, &error); |
1258 | ++ |
1259 | ++ if (error) { |
1260 | ++ nm_log_warn (LOGD_MB, "ofono: connection failed; couldn't read context properties (%d) %s", |
1261 | ++ error ? error->code : -1, |
1262 | ++ error && error->message ? error->message : "(unknown)"); |
1263 | ++ |
1264 | ++ g_clear_error (&error); |
1265 | ++ goto error; |
1266 | ++ } |
1267 | ++ |
1268 | ++ if (properties == NULL) { |
1269 | ++ nm_log_warn (LOGD_MB, "ofono: connection failed; no context properties returned"); |
1270 | ++ goto error; |
1271 | ++ } |
1272 | ++ |
1273 | ++ v_dict = g_variant_get_child_value (properties, 0); |
1274 | ++ g_assert (v_dict); |
1275 | ++ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT)); |
1276 | ++ |
1277 | ++ g_variant_unref (properties); |
1278 | ++ |
1279 | ++ if (!g_variant_lookup (v_dict, "Active", "b", &active)) { |
1280 | ++ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Active' property"); |
1281 | ++ goto error; |
1282 | ++ } |
1283 | ++ |
1284 | ++ /* Watch for custom ofono PropertyChanged signals */ |
1285 | ++ _nm_dbus_signal_connect (priv->context_proxy, |
1286 | ++ "PropertyChanged", |
1287 | ++ G_VARIANT_TYPE ("(sv)"), |
1288 | ++ G_CALLBACK (context_property_changed), |
1289 | ++ self); |
1290 | ++ |
1291 | ++ if (active) { |
1292 | ++ nm_log_dbg (LOGD_MB, "connection is already Active"); |
1293 | ++ |
1294 | ++ settings = g_variant_lookup_value (v_dict, "Settings", G_VARIANT_TYPE_VARDICT); |
1295 | ++ if (settings == NULL) { |
1296 | ++ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Settings' property"); |
1297 | ++ goto error; |
1298 | ++ } |
1299 | ++ |
1300 | ++ handle_settings (settings, user_data); |
1301 | ++ g_variant_unref (settings); |
1302 | ++ |
1303 | ++ } else |
1304 | ++ g_dbus_proxy_call (priv->context_proxy, |
1305 | ++ "SetProperty", |
1306 | ++ g_variant_new ("(sv)", |
1307 | ++ "Active", |
1308 | ++ g_variant_new ("b", TRUE)), |
1309 | ++ G_DBUS_CALL_FLAGS_NONE, |
1310 | ++ 20000, |
1311 | ++ NULL, |
1312 | ++ (GAsyncReadyCallback) stage1_prepare_done, |
1313 | ++ g_object_ref (self)); |
1314 | ++ |
1315 | ++ g_variant_unref (v_dict); |
1316 | ++ |
1317 | ++ return; |
1318 | ++ |
1319 | ++error: |
1320 | ++ if (properties) |
1321 | ++ g_variant_unref (properties); |
1322 | ++ |
1323 | ++ if (v_dict) |
1324 | ++ g_variant_unref (v_dict); |
1325 | ++ |
1326 | ++ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
1327 | ++ NM_DEVICE_STATE_REASON_MODEM_BUSY); |
1328 | ++} |
1329 | ++ |
1330 | ++static void |
1331 | + context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data) |
1332 | + { |
1333 | + NMModemOfono *self = NM_MODEM_OFONO (user_data); |
1334 | + NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
1335 | ++ gboolean context_active; |
1336 | + GError *error = NULL; |
1337 | ++ GVariant *v_dict; |
1338 | ++ GVariant *active_property; |
1339 | ++ GVariant *settings_property; |
1340 | + |
1341 | + nm_log_dbg (LOGD_MB, "%s:", __func__); |
1342 | + |
1343 | +@@ -1087,23 +1183,18 @@ context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_dat |
1344 | + if (priv->ip4_config) |
1345 | + g_clear_object (&priv->ip4_config); |
1346 | + |
1347 | +- /* Watch for custom ofono PropertyChanged signals */ |
1348 | +- _nm_dbus_signal_connect (priv->context_proxy, |
1349 | +- "PropertyChanged", |
1350 | +- G_VARIANT_TYPE ("(sv)"), |
1351 | +- G_CALLBACK (context_property_changed), |
1352 | +- self); |
1353 | +- |
1354 | ++ /* As ofono doesn't properly implement DBus.Properties, we need to |
1355 | ++ * query the ConnectionContextinteface directly to get the current |
1356 | ++ * property values vs. using g_dbus_proxy_get_cached_property. |
1357 | ++ */ |
1358 | + g_dbus_proxy_call (priv->context_proxy, |
1359 | +- "SetProperty", |
1360 | +- g_variant_new ("(sv)", |
1361 | +- "Active", |
1362 | +- g_variant_new ("b", TRUE)), |
1363 | +- G_DBUS_CALL_FLAGS_NONE, |
1364 | +- 20000, |
1365 | +- NULL, |
1366 | +- (GAsyncReadyCallback) stage1_prepare_done, |
1367 | +- g_object_ref (self)); |
1368 | ++ "GetProperties", |
1369 | ++ NULL, |
1370 | ++ G_DBUS_CALL_FLAGS_NONE, |
1371 | ++ 20000, |
1372 | ++ NULL, |
1373 | ++ (GAsyncReadyCallback) context_properties_cb, |
1374 | ++ g_object_ref (self)); |
1375 | + } |
1376 | + |
1377 | + static void |
1378 | +@@ -1112,8 +1203,8 @@ do_context_activate (NMModemOfono *self) |
1379 | + NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
1380 | + GValue value = G_VALUE_INIT; |
1381 | + |
1382 | +- g_return_val_if_fail (self != NULL, FALSE); |
1383 | +- g_return_val_if_fail (NM_IS_MODEM_OFONO (self), FALSE); |
1384 | ++ g_assert (self != NULL); |
1385 | ++ g_assert (NM_IS_MODEM_OFONO (self)); |
1386 | + |
1387 | + nm_log_dbg (LOGD_MB, "in %s", __func__); |
1388 | + |
1389 | +diff --git a/src/devices/wwan/nm-modem-ofono.h b/src/devices/wwan/nm-modem-ofono.h |
1390 | +index fa79e15..02eca11 100644 |
1391 | +--- a/src/devices/wwan/nm-modem-ofono.h |
1392 | ++++ b/src/devices/wwan/nm-modem-ofono.h |
1393 | +@@ -41,6 +41,8 @@ G_BEGIN_DECLS |
1394 | + #define OFONO_DBUS_INTERFACE_CONNECTION_CONTEXT "org.ofono.ConnectionContext" |
1395 | + #define OFONO_DBUS_INTERFACE_SIM_MANAGER "org.ofono.SimManager" |
1396 | + |
1397 | ++#define OFONO_ERROR_IN_PROGRESS "org.ofono.Error.InProgress" |
1398 | ++ |
1399 | + typedef enum { |
1400 | + NM_OFONO_ERROR_CONNECTION_NOT_OFONO = 0, /*< nick=ConnectionNotOfono >*/ |
1401 | + NM_OFONO_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/ |
1402 | diff --git a/debian/rules b/debian/rules |
1403 | index 2e449a4..2b6b175 100755 |
1404 | --- a/debian/rules |
1405 | +++ b/debian/rules |
1406 | @@ -27,6 +27,7 @@ override_dh_auto_configure: |
1407 | --with-dnsmasq=/usr/sbin/dnsmasq \ |
1408 | --with-dnssec-trigger=/usr/lib/dnssec-trigger/dnssec-trigger-script \ |
1409 | --with-systemdsystemunitdir=/lib/systemd/system \ |
1410 | + --with-systemd-journal=no \ |
1411 | --with-udev-dir=/lib/udev \ |
1412 | --with-crypto=gnutls \ |
1413 | --with-session-tracking=systemd \ |
1414 | @@ -36,6 +37,7 @@ override_dh_auto_configure: |
1415 | --with-nmcli \ |
1416 | --disable-more-warnings \ |
1417 | --disable-modify-system \ |
1418 | + --disable-bluez5 \ |
1419 | --enable-polkit \ |
1420 | --enable-polkit-agent \ |
1421 | --enable-ppp \ |
1422 | @@ -46,8 +48,7 @@ override_dh_auto_configure: |
1423 | --enable-concheck \ |
1424 | --enable-teamdctl=no \ |
1425 | --enable-vala \ |
1426 | - --with-tests \ |
1427 | - --enable-bluez5-dun |
1428 | + --with-tests |
1429 | |
1430 | override_dh_install: |
1431 | rm -vf $(CURDIR)/debian/tmp/etc/init.d/NetworkManager |
1432 | @@ -60,6 +61,15 @@ override_dh_install: |
1433 | mkdir -p debian/network-manager/etc/dnsmasq.d |
1434 | cp debian/network-manager.dnsmasq debian/network-manager/etc/dnsmasq.d/network-manager |
1435 | |
1436 | + # copy indicator-network polkit configuration |
1437 | + mkdir -p debian/network-manager/etc/polkit-1/localauthority/50-local.d |
1438 | + cp debian/indicator-network.pkla \ |
1439 | + debian/network-manager/etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla |
1440 | + |
1441 | + # copy powersave configuration |
1442 | + mkdir -p debian/network-manager/etc/NetworkManager/conf.d |
1443 | + cp debian/default-wifi-powersave-on.conf debian/network-manager/etc/NetworkManager/conf.d/ |
1444 | + |
1445 | override_dh_installinit: |
1446 | dh_installinit --noscripts |
1447 | |
1448 | @@ -67,7 +77,7 @@ override_dh_makeshlibs: |
1449 | dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/NetworkManager/ -X/usr/lib/pppd/ |
1450 | |
1451 | override_dh_strip: |
1452 | - dh_strip --dbgsym-migration='network-manager-dbg (<< 1.1.91-2~)' |
1453 | + dh_strip --dbg-package=network-manager-dbg |
1454 | |
1455 | override_dh_systemd_start: |
1456 | dh_link lib/systemd/system/NetworkManager.service \ |
LGTM