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