Merge lp:~awe/network-manager/update-1.2 into lp:~network-manager/network-manager/ubuntu
- update-1.2
- Merge into ubuntu
Status: | Merged |
---|---|
Merged at revision: | 1018 |
Proposed branch: | lp:~awe/network-manager/update-1.2 |
Merge into: | lp:~network-manager/network-manager/ubuntu |
Diff against target: |
12570 lines (+3949/-6206) 78 files modified
debian/changelog (+72/-0) debian/control (+7/-6) debian/copyright (+27/-2) debian/libnm-glib4.symbols (+4/-0) debian/libnm-util2.symbols (+4/-0) debian/libnm0.symbols (+215/-11) debian/network-manager-dev.install (+1/-0) debian/network-manager.dirs (+2/-1) debian/network-manager.install (+1/-2) debian/network-manager.maintscript (+5/-4) debian/network-manager.upstart (+0/-24) debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch (+0/-33) debian/patches/0001-dns-use-DBus-to-make-dnsmasq-nameserver-changes.patch (+428/-394) debian/patches/0001-libnm-libnm-util-add-Wi-Fi-powersave-property.patch (+0/-253) debian/patches/0001-wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch (+0/-108) debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch (+0/-1653) debian/patches/0002-Force-online-state-with-unmanaged-devices.patch (+0/-194) debian/patches/0002-fixup-libnm-libnm-util-add-Wi-Fi-powersave-property.patch (+0/-30) debian/patches/0002-wifi-cull-the-scan-list-before-signalling-ScanDone-b.patch (+0/-171) debian/patches/0002-wifi-expose-the-last_seen-property-for-a-NMAccessPoi.patch (+0/-337) debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch (+0/-61) debian/patches/0003-cli-add-support-for-wifi.powersave-setting.patch (+0/-89) debian/patches/0004-Use-symlinks-for-nmtui.patch (+0/-35) debian/patches/0004-wifi-set-wireless-power-save-for-nl80211-devices-whe.patch (+0/-242) debian/patches/0005-Mark-virtual-ethernet-interfaces-as-unmanaged.patch (+0/-69) debian/patches/0005-fixup-wifi-set-wireless-power-save-for-nl80211-devic.patch (+0/-50) debian/patches/0008-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch (+0/-23) debian/patches/0019-Don-t-make-NetworkManager-D-Bus-activatable.patch (+0/-40) debian/patches/Check-at-runtime-whether-to-start-ModemManager.patch (+70/-0) debian/patches/Debian-specific-tweaks-for-NetworkManager-systemd-se.patch (+34/-0) debian/patches/Don-t-block-network.target-on-NetworkManager-wait-on.patch (+54/-0) debian/patches/Don-t-make-NetworkManager-D-Bus-activatable.patch (+40/-0) debian/patches/Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch (+77/-0) debian/patches/Fix-iscsiadm-path.patch (+23/-0) debian/patches/Force-online-state-with-unmanaged-devices.patch (+193/-0) debian/patches/add_ofono_settings_support.patch (+169/-179) debian/patches/add_sendsigs_omissions.patch (+0/-40) debian/patches/adhoc_use_wpa_rsn_part1.patch (+12/-12) debian/patches/adhoc_use_wpa_rsn_part2.patch (+83/-42) debian/patches/conditional_libteam_tests.patch (+2/-2) debian/patches/default_powersave_on.patch (+5/-4) debian/patches/demarshal_int64_properties.patch (+0/-23) debian/patches/disable_general_with_expect_test.patch (+4/-4) debian/patches/dnsmasq-vpn-dns-filtering.patch (+65/-65) debian/patches/fix-NetworkManager-wait-online.service.patch (+0/-28) debian/patches/fix-arping-path.patch (+38/-0) debian/patches/git_avoid_conflict_reinstall_dev_route_e439478c.patch (+0/-377) debian/patches/git_config_parse_cmdline_args_8a22a981.patch (+0/-33) debian/patches/git_fix_broken_ssid_01.patch (+0/-41) debian/patches/git_fix_broken_ssid_02.patch (+0/-26) debian/patches/git_fix_duplicate_unittest_names_7b70a840.patch (+0/-247) debian/patches/git_fix_race_external_down_e29ab543.patch (+0/-111) debian/patches/git_route_fixes_part1_207ab013.patch (+0/-109) debian/patches/git_route_fixes_part2_529591d8.patch (+0/-106) debian/patches/git_set_vpn_mtu_9736327b.patch (+0/-53) debian/patches/ignore_rfkill_if_urfkill_is_present.patch (+144/-166) debian/patches/ignore_rild_modem_devices.patch (+3/-3) debian/patches/lp1099983_ignore-p2p-wifi-devices.patch (+3/-3) debian/patches/lp1425172-fix-wifi-scanlist-cull.patch (+0/-33) debian/patches/lp1444162-add-ip6-config-to-nm-ofono-connections.patch (+0/-47) debian/patches/lp1445080-modify-device-modem-avail.patch (+3/-4) debian/patches/lp1445080-nm-modem-check-for-set-mm-enabled-func.patch (+0/-32) debian/patches/lp1446689_git_use_kernel_pppoe_6fdfb031.patch (+0/-138) debian/patches/lp1461593-add-modem-reconnect-delay-to-policy.patch (+9/-18) debian/patches/lp1461593-add-nm-settings-connection-reset-retries-methods.patch (+24/-24) debian/patches/lp1496434_warn_on_invalid_new_link.patch (+0/-35) debian/patches/lp1499827_device_avoid_undefined_mtu_c44069c1.patch (+0/-22) debian/patches/lp1499827_dont_change_unset_mtu_a92d8b0c.patch (+0/-46) debian/patches/lp936712_dnsmasq_ip6_ns_ordering.patch (+2/-2) debian/patches/monotonic_timestamp_as_boottime.patch (+0/-115) debian/patches/nm-change-dnsmasq-parameters.diff (+10/-11) debian/patches/prioritize_3g_later.patch (+0/-52) debian/patches/quit_dhclient_on_exit.patch (+0/-68) debian/patches/series (+15/-46) debian/patches/whoopsie-daisy-dbus-support.patch (+3/-3) debian/patches/wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch (+94/-0) debian/patches/wwan-add-ofono-modem-support.patch (+1984/-0) debian/rules (+20/-4) |
To merge this branch: | bzr merge lp:~awe/network-manager/update-1.2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mathieu Trudel-Lapierre | Pending | ||
Review via email: mp+291271@code.launchpad.net |
Commit message
Description of the change
This is an update of lp:~cyphermox/network-manager/update-1.2 to rebase it on the recently released NM 1.2 rc1 release ( 1.1.93 ).
The update drops the following patches which have been upstreamed:
- tests-fix-
- wifi-hack-
- lp1496434_
The remaining patches have been refreshed where needed, and the issue with incorrect nameservers fixed in the d/p/0001-
Tested WPA2 WiFi on my Thinkpad 410s, and also tested that the Canonical VPN works correctly.
- 1031. By Tony Espy
-
Remove stale lp1444162-
add-ip6- config- to-nm-ofono- connections. patch Already folded into add_ofono_
settings_ support. patch. - 1032. By Tony Espy
-
Removed stale lp1445080-
nm-modem- check-for- set-mm- enabled- func.patch Code has been upstreamed.
- 1033. By Tony Espy
-
Rename ignore_
rmnet_devices. path to ignore_ rild_modem_ devices. patch - 1034. By Tony Espy
-
Restore wifi-Signal-
on-the- wifi-device- when-its- supplicant- i.patch - 1035. By Tony Espy
-
wwan-add-
ofono-modem- support. patch: fix crash Fix a crash caused by a bad update of the patch, which failed
to remove a g_error call from NM_ASSERT_VALID_PATH_ COMPONENT
( which was removed in the earlier version of the patch ).
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2016-02-26 20:32:27 +0000 |
3 | +++ debian/changelog 2016-04-08 14:51:24 +0000 |
4 | @@ -1,3 +1,75 @@ |
5 | +network-manager (1.1.93-0ubuntu1) UNRELEASED; urgency=medium |
6 | + |
7 | + * New upstream release. |
8 | + * Resynchronize with Debian; remaining changes: |
9 | + - debian/control: |
10 | + - Build-Depends on libgnutls-dev and libgcrypt20-dev; drop libteam-dev; |
11 | + added valac and dbus-test-runner. |
12 | + - Updated Vcs tags; enabled autopkgtests. |
13 | + - Reshuffle Depends for network-manager due to main |
14 | + inclusion requirements, and add Breaks for old versions of plugins. |
15 | + - network-manager Conflicts with connman. |
16 | + - update network-manager Description since we don't ship with team |
17 | + support yet, and dnsmasq-base isn't optional. |
18 | + - added a network-manager-dbg package for debug symbols. |
19 | + - debian/ifblacklist_migrate.sh: update to better handle interfaces stanza. |
20 | + - debian/libnm*-dev.install: ship vala bindings. |
21 | + - debian/NetworkManager.conf: enable the ofono plugin and dnsmasq use as a |
22 | + local DNS cache. |
23 | + - debian/network-manager.dnsmasq: enable bind-interfaces for dnsmasq config. |
24 | + - debian/network-manager.install: ship the ofono plugin, Apport hook and |
25 | + examples. |
26 | + - debian/network-manager.links: link apport hook to the right directory. |
27 | + - debian/network-manager.postinst: Don't need to migrate from sysvinit, |
28 | + just keep removing the sysvinit script symlinks. |
29 | + - debian/network-manager.postinst: Don't add the netdev group. |
30 | + - debian/network-manager.postinst: Notify the user a reboot may be |
31 | + required after upgrade. |
32 | + - Remaining patches: |
33 | + - whoopsie-daisy-dbus-support.patch |
34 | + - 0001-dns-use-DBus-to-make-dnsmasq-nameserver-changes.patch |
35 | + - nm-change-dnsmasq-parameters.diff |
36 | + - dnsmasq-vpn-dns-filtering.patch |
37 | + - lp936712_dnsmasq_ip6_ns_ordering.patch |
38 | + - adhoc_use_wpa_rsn_part1.patch |
39 | + - adhoc_use_wpa_rsn_part2.patch |
40 | + - default_powersave_on.patch |
41 | + - ignore_rmnet_devices.patch |
42 | + - lp1099983_ignore-p2p-wifi-devices.patch |
43 | + - wwan-add-ofono-modem-support.patch |
44 | + - lp1461593-add-nm-settings-connection-reset-retries-methods.patch |
45 | + - add_ofono_settings_support.patch |
46 | + - lp1445080-modify-device-modem-avail.patch |
47 | + - ignore_rfkill_if_urfkill_is_present.patch |
48 | + - conditional_libteam_tests.patch |
49 | + - disable_general_with_expect_test.patch |
50 | + - debian/rules: |
51 | + - configure: disable libteam. |
52 | + - configure: enable building vala bindings. |
53 | + - configure: enable running tests during the build. |
54 | + - don't install sysvinit scripts. |
55 | + - copy over dnsmasq configuration files. |
56 | + - don't restart NetworkManager on upgrade. |
57 | + - add --with-udev-dir to ensure rules end up |
58 | + in the right place. |
59 | + - debian/source_network-manager.py: ship an Apport hook. |
60 | + - debian/tests: Ship autopkgtests for automated functional testing. |
61 | + * Refreshed all patches. |
62 | + * Renamed 0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch |
63 | + to wwan-add-ofono-modem-support.patch as this patch needed to be |
64 | + extensively re-worked due to dbus-glib being deprecated in NM1.2. |
65 | + * Remove upstreamed patches: |
66 | + - tests-fix-bashism-in-run-test-dbus-session.sh.patch |
67 | + - wifi-hack-for-wext-devices-reporting-IW_MODE_AUTO-configu.patch |
68 | + - lp1496434_warn_on_invalid_new_link.patch: alternate fix landed |
69 | + upstream which ensures that a valid error instance is returned |
70 | + by the factory_create_link method. |
71 | + * Update all symbols files. |
72 | + * Rename ignore_rmnet_devices.path to ignore_rild_modem_devices.patch |
73 | + * Restore wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch |
74 | + |
75 | + -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Thu, 03 Mar 2016 15:51:48 -0500 |
76 | + |
77 | network-manager (1.0.4-0ubuntu10) xenial; urgency=medium |
78 | |
79 | * No-change rebuild for gnutls transition. |
80 | |
81 | === modified file 'debian/control' |
82 | --- debian/control 2015-08-20 09:47:16 +0000 |
83 | +++ debian/control 2016-04-08 14:51:24 +0000 |
84 | @@ -16,7 +16,7 @@ |
85 | libnl-3-dev (>= 3.2.8), |
86 | libnl-route-3-dev (>= 3.2.8), |
87 | libnl-genl-3-dev (>= 3.2.8), |
88 | - ppp-dev (>= 2.4.6), |
89 | + ppp-dev (>= 2.4.7-1+1), |
90 | libpolkit-gobject-1-dev, |
91 | libpolkit-agent-1-dev (>= 0.97), |
92 | libgnutls-dev, |
93 | @@ -28,7 +28,7 @@ |
94 | libgudev-1.0-dev (>= 165), |
95 | libgirepository1.0-dev (>= 0.10.7-1~), |
96 | gobject-introspection (>= 0.9.12-4~), |
97 | - libsoup2.4-dev (>= 2.26), |
98 | + libsoup2.4-dev (>= 2.40), |
99 | gtk-doc-tools, |
100 | perl, |
101 | libyaml-perl, |
102 | @@ -38,13 +38,14 @@ |
103 | libreadline-dev, |
104 | libnewt-dev (>= 0.52.15), |
105 | libbluetooth-dev (>= 5), |
106 | + dbus <!nocheck>, |
107 | + python-gi <!nocheck>, |
108 | valac (>= 0.17.1.24), |
109 | dbus-test-runner, |
110 | - python-dbus, |
111 | - python-gi, |
112 | -Standards-Version: 3.9.6 |
113 | + python-dbus <!nocheck> |
114 | +Standards-Version: 3.9.7 |
115 | Vcs-Bzr: https://code.launchpad.net/~network-manager/network-manager/ubuntu |
116 | -Homepage: http://www.gnome.org/projects/NetworkManager/ |
117 | +Homepage: https://wiki.gnome.org/Projects/NetworkManager |
118 | XS-Testsuite: autopkgtest |
119 | |
120 | Package: network-manager |
121 | |
122 | === modified file 'debian/copyright' |
123 | --- debian/copyright 2012-03-26 14:27:33 +0000 |
124 | +++ debian/copyright 2016-04-08 14:51:24 +0000 |
125 | @@ -3,16 +3,24 @@ |
126 | Source: http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/ |
127 | |
128 | Files: * |
129 | -Copyright: 2004 - 2012 Red Hat, Inc. |
130 | +Copyright: 2004 - 2014 Red Hat, Inc. |
131 | 2005 - 2009 Novell, Inc. |
132 | License: GPL-2+ |
133 | |
134 | Files: libnm-util/* |
135 | libnm-glib/* |
136 | -Copyright: 2005 - 2012 Red Hat, Inc. |
137 | + libnm-core/* |
138 | + libnm/* |
139 | +Copyright: 2005 - 2014 Red Hat, Inc. |
140 | 2005 - 2009 Novell, Inc. |
141 | License: LGPL-2+ |
142 | |
143 | +Files: src/systemd/* |
144 | +Copyright: 2013 - 2015 Tom Gundersen |
145 | + 2014 Susant Sahani |
146 | + 2014 - 2015 Intel Corporation. All rights reserved. |
147 | +License: LGPL-2.1+ |
148 | + |
149 | License: GPL-2+ |
150 | This package is free software; you can redistribute it and/or modify |
151 | it under the terms of the GNU General Public License as published by |
152 | @@ -47,3 +55,20 @@ |
153 | On Debian systems, the complete text of the GNU Lesser General |
154 | Public License can be found in "/usr/share/common-licenses/LGPL-2". |
155 | |
156 | +License: LGPL-2.1+ |
157 | + This package is free software; you can redistribute it and/or |
158 | + modify it under the terms of the GNU Lesser General Public |
159 | + License as published by the Free Software Foundation; either |
160 | + version 2.1 of the License, or (at your option) any later version. |
161 | + . |
162 | + This package is distributed in the hope that it will be useful, |
163 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
164 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
165 | + Lesser General Public License for more details. |
166 | + . |
167 | + You should have received a copy of the GNU General Public License |
168 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
169 | + . |
170 | + On Debian systems, the complete text of the GNU Lesser General |
171 | + Public License can be found in "/usr/share/common-licenses/LGPL-2.1". |
172 | + |
173 | |
174 | === modified file 'debian/libnm-glib4.symbols' |
175 | --- debian/libnm-glib4.symbols 2015-08-20 09:47:16 +0000 |
176 | +++ debian/libnm-glib4.symbols 2016-04-08 14:51:24 +0000 |
177 | @@ -10,6 +10,7 @@ |
178 | nm_access_point_get_flags@Base 0.7.999 |
179 | nm_access_point_get_frequency@Base 0.7.999 |
180 | nm_access_point_get_hw_address@Base 0.7.999 |
181 | + nm_access_point_get_last_seen@Base 1.1.90 |
182 | nm_access_point_get_max_bitrate@Base 0.7.999 |
183 | nm_access_point_get_mode@Base 0.7.999 |
184 | nm_access_point_get_rsn_flags@Base 0.7.999 |
185 | @@ -45,6 +46,7 @@ |
186 | nm_client_error_quark@Base 0.9.10.0 |
187 | nm_client_get_activating_connection@Base 0.9.8.8 |
188 | nm_client_get_active_connections@Base 0.7.999 |
189 | + nm_client_get_all_devices@Base 1.1.90 |
190 | nm_client_get_connectivity@Base 0.9.8.8 |
191 | nm_client_get_device_by_iface@Base 0.9.0 |
192 | nm_client_get_device_by_path@Base 0.7.999 |
193 | @@ -156,6 +158,7 @@ |
194 | nm_device_infiniband_get_hw_address@Base 0.9.4.0 |
195 | nm_device_infiniband_get_type@Base 0.9.4.0 |
196 | nm_device_infiniband_new@Base 0.9.4.0 |
197 | + nm_device_is_real@Base 1.1.90 |
198 | nm_device_is_software@Base 1.0.0 |
199 | nm_device_modem_error_get_type@Base 0.9.4.0 |
200 | nm_device_modem_error_quark@Base 0.9.4.0 |
201 | @@ -171,6 +174,7 @@ |
202 | nm_device_olpc_mesh_get_type@Base 0.9.4.0 |
203 | nm_device_olpc_mesh_new@Base 0.9.4.0 |
204 | nm_device_set_autoconnect@Base 0.9.5.95 |
205 | + nm_device_set_managed@Base 1.1.90 |
206 | nm_device_team_error_get_type@Base 0.9.10.0 |
207 | nm_device_team_error_quark@Base 0.9.10.0 |
208 | nm_device_team_get_carrier@Base 0.9.10.0 |
209 | |
210 | === modified file 'debian/libnm-util2.symbols' |
211 | --- debian/libnm-util2.symbols 2015-08-20 09:47:16 +0000 |
212 | +++ debian/libnm-util2.symbols 2016-04-08 14:51:24 +0000 |
213 | @@ -1,4 +1,6 @@ |
214 | libnm-util.so.2 libnm-util2 #MINVER# |
215 | + _nm_connection_new_from_hash@Base 1.1.93 |
216 | + _nm_connection_replace_settings@Base 1.1.93 |
217 | nm_connection_add_setting@Base 0.7.0 |
218 | nm_connection_clear_secrets@Base 0.7.0 |
219 | nm_connection_clear_secrets_with_flags@Base 0.9.1.95 |
220 | @@ -354,6 +356,7 @@ |
221 | nm_setting_ip4_config_get_dhcp_client_id@Base 0.7.0 |
222 | nm_setting_ip4_config_get_dhcp_hostname@Base 0.7.0 |
223 | nm_setting_ip4_config_get_dhcp_send_hostname@Base 0.7.999 |
224 | + nm_setting_ip4_config_get_dhcp_timeout@Base 1.1.90 |
225 | nm_setting_ip4_config_get_dns@Base 0.7.0 |
226 | nm_setting_ip4_config_get_dns_search@Base 0.7.0 |
227 | nm_setting_ip4_config_get_ignore_auto_dns@Base 0.7.0 |
228 | @@ -561,6 +564,7 @@ |
229 | nm_setting_wireless_get_mtu@Base 0.7.0 |
230 | nm_setting_wireless_get_num_mac_blacklist_items@Base 0.9.10.0 |
231 | nm_setting_wireless_get_num_seen_bssids@Base 0.7.0 |
232 | + nm_setting_wireless_get_powersave@Base 1.1.90 |
233 | nm_setting_wireless_get_rate@Base 0.7.0 |
234 | nm_setting_wireless_get_security@Base 0.7.0 |
235 | nm_setting_wireless_get_seen_bssid@Base 0.7.0 |
236 | |
237 | === modified file 'debian/libnm0.symbols' |
238 | --- debian/libnm0.symbols 2015-08-20 09:47:16 +0000 |
239 | +++ debian/libnm0.symbols 2016-04-08 14:51:24 +0000 |
240 | @@ -1,6 +1,8 @@ |
241 | libnm.so.0 libnm0 #MINVER# |
242 | libnm_1_0_0@libnm_1_0_0 1.0.0 |
243 | libnm_1_0_4@libnm_1_0_4 1.0.4 |
244 | + libnm_1_0_6@libnm_1_0_6 1.0.6 |
245 | + libnm_1_2_0@libnm_1_2_0 1.1.90 |
246 | nm_802_11_ap_flags_get_type@libnm_1_0_0 1.0.0 |
247 | nm_802_11_ap_security_flags_get_type@libnm_1_0_0 1.0.0 |
248 | nm_802_11_mode_get_type@libnm_1_0_0 1.0.0 |
249 | @@ -9,6 +11,8 @@ |
250 | nm_access_point_get_bssid@libnm_1_0_0 1.0.0 |
251 | nm_access_point_get_flags@libnm_1_0_0 1.0.0 |
252 | nm_access_point_get_frequency@libnm_1_0_0 1.0.0 |
253 | + nm_access_point_get_last_seen@libnm_1_0_6 1.1.90 |
254 | + nm_access_point_get_last_seen@libnm_1_2_0 1.1.90 |
255 | nm_access_point_get_max_bitrate@libnm_1_0_0 1.0.0 |
256 | nm_access_point_get_mode@libnm_1_0_0 1.0.0 |
257 | nm_access_point_get_rsn_flags@libnm_1_0_0 1.0.0 |
258 | @@ -52,6 +56,7 @@ |
259 | nm_client_error_quark@libnm_1_0_0 1.0.0 |
260 | nm_client_get_activating_connection@libnm_1_0_0 1.0.0 |
261 | nm_client_get_active_connections@libnm_1_0_0 1.0.0 |
262 | + nm_client_get_all_devices@libnm_1_2_0 1.1.90 |
263 | nm_client_get_connection_by_id@libnm_1_0_0 1.0.0 |
264 | nm_client_get_connection_by_path@libnm_1_0_0 1.0.0 |
265 | nm_client_get_connection_by_uuid@libnm_1_0_0 1.0.0 |
266 | @@ -124,6 +129,8 @@ |
267 | nm_connection_get_setting_infiniband@libnm_1_0_0 1.0.0 |
268 | nm_connection_get_setting_ip4_config@libnm_1_0_0 1.0.0 |
269 | nm_connection_get_setting_ip6_config@libnm_1_0_0 1.0.0 |
270 | + nm_connection_get_setting_ip_tunnel@libnm_1_2_0 1.1.90 |
271 | + nm_connection_get_setting_macvlan@libnm_1_2_0 1.1.90 |
272 | nm_connection_get_setting_olpc_mesh@libnm_1_0_0 1.0.0 |
273 | nm_connection_get_setting_ppp@libnm_1_0_0 1.0.0 |
274 | nm_connection_get_setting_pppoe@libnm_1_0_0 1.0.0 |
275 | @@ -132,6 +139,7 @@ |
276 | nm_connection_get_setting_team_port@libnm_1_0_0 1.0.0 |
277 | nm_connection_get_setting_vlan@libnm_1_0_0 1.0.0 |
278 | nm_connection_get_setting_vpn@libnm_1_0_0 1.0.0 |
279 | + nm_connection_get_setting_vxlan@libnm_1_2_0 1.1.90 |
280 | nm_connection_get_setting_wimax@libnm_1_0_0 1.0.0 |
281 | nm_connection_get_setting_wired@libnm_1_0_0 1.0.0 |
282 | nm_connection_get_setting_wireless@libnm_1_0_0 1.0.0 |
283 | @@ -151,6 +159,7 @@ |
284 | nm_connection_to_dbus@libnm_1_0_0 1.0.0 |
285 | nm_connection_update_secrets@libnm_1_0_0 1.0.0 |
286 | nm_connection_verify@libnm_1_0_0 1.0.0 |
287 | + nm_connection_verify_secrets@libnm_1_2_0 1.1.90 |
288 | nm_connectivity_state_get_type@libnm_1_0_0 1.0.0 |
289 | nm_crypto_error_get_type@libnm_1_0_0 1.0.0 |
290 | nm_crypto_error_quark@libnm_1_0_0 1.0.0 |
291 | @@ -183,12 +192,16 @@ |
292 | nm_device_ethernet_get_carrier@libnm_1_0_0 1.0.0 |
293 | nm_device_ethernet_get_hw_address@libnm_1_0_0 1.0.0 |
294 | nm_device_ethernet_get_permanent_hw_address@libnm_1_0_0 1.0.0 |
295 | + nm_device_ethernet_get_s390_subchannels@libnm_1_2_0 1.1.90 |
296 | nm_device_ethernet_get_speed@libnm_1_0_0 1.0.0 |
297 | nm_device_ethernet_get_type@libnm_1_0_0 1.0.0 |
298 | nm_device_filter_connections@libnm_1_0_0 1.0.0 |
299 | nm_device_generic_get_hw_address@libnm_1_0_0 1.0.0 |
300 | nm_device_generic_get_type@libnm_1_0_0 1.0.0 |
301 | nm_device_get_active_connection@libnm_1_0_0 1.0.0 |
302 | + nm_device_get_applied_connection@libnm_1_2_0 1.1.91 |
303 | + nm_device_get_applied_connection_async@libnm_1_2_0 1.1.91 |
304 | + nm_device_get_applied_connection_finish@libnm_1_2_0 1.1.91 |
305 | nm_device_get_autoconnect@libnm_1_0_0 1.0.0 |
306 | nm_device_get_available_connections@libnm_1_0_0 1.0.0 |
307 | nm_device_get_capabilities@libnm_1_0_0 1.0.0 |
308 | @@ -205,8 +218,12 @@ |
309 | nm_device_get_ip4_config@libnm_1_0_0 1.0.0 |
310 | nm_device_get_ip6_config@libnm_1_0_0 1.0.0 |
311 | nm_device_get_ip_iface@libnm_1_0_0 1.0.0 |
312 | + nm_device_get_lldp_neighbors@libnm_1_2_0 1.1.90 |
313 | nm_device_get_managed@libnm_1_0_0 1.0.0 |
314 | + nm_device_get_metered@libnm_1_0_6 1.1.90 |
315 | + nm_device_get_metered@libnm_1_2_0 1.1.90 |
316 | nm_device_get_mtu@libnm_1_0_0 1.0.0 |
317 | + nm_device_get_nm_plugin_missing@libnm_1_2_0 1.1.90 |
318 | nm_device_get_physical_port_id@libnm_1_0_0 1.0.0 |
319 | nm_device_get_product@libnm_1_0_0 1.0.0 |
320 | nm_device_get_setting_type@libnm_1_0_0 1.0.0 |
321 | @@ -219,7 +236,26 @@ |
322 | nm_device_infiniband_get_carrier@libnm_1_0_0 1.0.0 |
323 | nm_device_infiniband_get_hw_address@libnm_1_0_0 1.0.0 |
324 | nm_device_infiniband_get_type@libnm_1_0_0 1.0.0 |
325 | + nm_device_ip_tunnel_get_encapsulation_limit@libnm_1_2_0 1.1.90 |
326 | + nm_device_ip_tunnel_get_flow_label@libnm_1_2_0 1.1.90 |
327 | + nm_device_ip_tunnel_get_input_key@libnm_1_2_0 1.1.90 |
328 | + nm_device_ip_tunnel_get_local@libnm_1_2_0 1.1.90 |
329 | + nm_device_ip_tunnel_get_mode@libnm_1_2_0 1.1.90 |
330 | + nm_device_ip_tunnel_get_output_key@libnm_1_2_0 1.1.90 |
331 | + nm_device_ip_tunnel_get_parent@libnm_1_2_0 1.1.90 |
332 | + nm_device_ip_tunnel_get_path_mtu_discovery@libnm_1_2_0 1.1.90 |
333 | + nm_device_ip_tunnel_get_remote@libnm_1_2_0 1.1.90 |
334 | + nm_device_ip_tunnel_get_tos@libnm_1_2_0 1.1.90 |
335 | + nm_device_ip_tunnel_get_ttl@libnm_1_2_0 1.1.90 |
336 | + nm_device_ip_tunnel_get_type@libnm_1_2_0 1.1.90 |
337 | + nm_device_is_real@libnm_1_2_0 1.1.90 |
338 | nm_device_is_software@libnm_1_0_0 1.0.0 |
339 | + nm_device_macvlan_get_hw_address@libnm_1_2_0 1.1.90 |
340 | + nm_device_macvlan_get_mode@libnm_1_2_0 1.1.90 |
341 | + nm_device_macvlan_get_no_promisc@libnm_1_2_0 1.1.90 |
342 | + nm_device_macvlan_get_parent@libnm_1_2_0 1.1.90 |
343 | + nm_device_macvlan_get_tap@libnm_1_2_0 1.1.90 |
344 | + nm_device_macvlan_get_type@libnm_1_2_0 1.1.90 |
345 | nm_device_modem_capabilities_get_type@libnm_1_0_0 1.0.0 |
346 | nm_device_modem_get_current_capabilities@libnm_1_0_0 1.0.0 |
347 | nm_device_modem_get_modem_capabilities@libnm_1_0_0 1.0.0 |
348 | @@ -228,19 +264,48 @@ |
349 | nm_device_olpc_mesh_get_companion@libnm_1_0_0 1.0.0 |
350 | nm_device_olpc_mesh_get_hw_address@libnm_1_0_0 1.0.0 |
351 | nm_device_olpc_mesh_get_type@libnm_1_0_0 1.0.0 |
352 | + nm_device_reapply@libnm_1_2_0 1.1.90 |
353 | + nm_device_reapply_async@libnm_1_2_0 1.1.90 |
354 | + nm_device_reapply_finish@libnm_1_2_0 1.1.90 |
355 | nm_device_set_autoconnect@libnm_1_0_0 1.0.0 |
356 | + nm_device_set_managed@libnm_1_2_0 1.1.90 |
357 | nm_device_state_get_type@libnm_1_0_0 1.0.0 |
358 | nm_device_state_reason_get_type@libnm_1_0_0 1.0.0 |
359 | nm_device_team_get_carrier@libnm_1_0_0 1.0.0 |
360 | nm_device_team_get_hw_address@libnm_1_0_0 1.0.0 |
361 | nm_device_team_get_slaves@libnm_1_0_0 1.0.0 |
362 | nm_device_team_get_type@libnm_1_0_0 1.0.0 |
363 | + nm_device_tun_get_group@libnm_1_2_0 1.1.90 |
364 | + nm_device_tun_get_hw_address@libnm_1_2_0 1.1.90 |
365 | + nm_device_tun_get_mode@libnm_1_2_0 1.1.90 |
366 | + nm_device_tun_get_multi_queue@libnm_1_2_0 1.1.90 |
367 | + nm_device_tun_get_no_pi@libnm_1_2_0 1.1.90 |
368 | + nm_device_tun_get_owner@libnm_1_2_0 1.1.90 |
369 | + nm_device_tun_get_type@libnm_1_2_0 1.1.90 |
370 | + nm_device_tun_get_vnet_hdr@libnm_1_2_0 1.1.90 |
371 | nm_device_type_get_type@libnm_1_0_0 1.0.0 |
372 | nm_device_vlan_get_carrier@libnm_1_0_0 1.0.0 |
373 | nm_device_vlan_get_hw_address@libnm_1_0_0 1.0.0 |
374 | nm_device_vlan_get_parent@libnm_1_0_0 1.0.0 |
375 | nm_device_vlan_get_type@libnm_1_0_0 1.0.0 |
376 | nm_device_vlan_get_vlan_id@libnm_1_0_0 1.0.0 |
377 | + nm_device_vxlan_get_ageing@libnm_1_2_0 1.1.90 |
378 | + nm_device_vxlan_get_dst_port@libnm_1_2_0 1.1.90 |
379 | + nm_device_vxlan_get_group@libnm_1_2_0 1.1.90 |
380 | + nm_device_vxlan_get_hw_address@libnm_1_2_0 1.1.90 |
381 | + nm_device_vxlan_get_id@libnm_1_2_0 1.1.90 |
382 | + nm_device_vxlan_get_l2miss@libnm_1_2_0 1.1.90 |
383 | + nm_device_vxlan_get_l3miss@libnm_1_2_0 1.1.90 |
384 | + nm_device_vxlan_get_learning@libnm_1_2_0 1.1.90 |
385 | + nm_device_vxlan_get_limit@libnm_1_2_0 1.1.90 |
386 | + nm_device_vxlan_get_local@libnm_1_2_0 1.1.90 |
387 | + nm_device_vxlan_get_parent@libnm_1_2_0 1.1.90 |
388 | + nm_device_vxlan_get_proxy@libnm_1_2_0 1.1.90 |
389 | + nm_device_vxlan_get_src_port_max@libnm_1_2_0 1.1.90 |
390 | + nm_device_vxlan_get_src_port_min@libnm_1_2_0 1.1.90 |
391 | + nm_device_vxlan_get_tos@libnm_1_2_0 1.1.90 |
392 | + nm_device_vxlan_get_ttl@libnm_1_2_0 1.1.90 |
393 | + nm_device_vxlan_get_type@libnm_1_2_0 1.1.90 |
394 | nm_device_wifi_capabilities_get_type@libnm_1_0_0 1.0.0 |
395 | nm_device_wifi_get_access_point_by_path@libnm_1_0_0 1.0.0 |
396 | nm_device_wifi_get_access_points@libnm_1_0_0 1.0.0 |
397 | @@ -254,6 +319,10 @@ |
398 | nm_device_wifi_request_scan@libnm_1_0_0 1.0.0 |
399 | nm_device_wifi_request_scan_async@libnm_1_0_0 1.0.0 |
400 | nm_device_wifi_request_scan_finish@libnm_1_0_0 1.0.0 |
401 | + nm_device_wifi_request_scan_options@libnm_1_0_6 1.1.90 |
402 | + nm_device_wifi_request_scan_options@libnm_1_2_0 1.1.90 |
403 | + nm_device_wifi_request_scan_options_async@libnm_1_0_6 1.1.90 |
404 | + nm_device_wifi_request_scan_options_async@libnm_1_2_0 1.1.90 |
405 | nm_device_wimax_get_active_nsp@libnm_1_0_0 1.0.0 |
406 | nm_device_wimax_get_bsid@libnm_1_0_0 1.0.0 |
407 | nm_device_wimax_get_center_frequency@libnm_1_0_0 1.0.0 |
408 | @@ -315,8 +384,19 @@ |
409 | nm_ip_route_set_next_hop_binary@libnm_1_0_0 1.0.0 |
410 | nm_ip_route_set_prefix@libnm_1_0_0 1.0.0 |
411 | nm_ip_route_unref@libnm_1_0_0 1.0.0 |
412 | + nm_ip_tunnel_mode_get_type@libnm_1_2_0 1.1.90 |
413 | + nm_lldp_neighbor_get_attr_names@libnm_1_2_0 1.1.90 |
414 | + nm_lldp_neighbor_get_attr_string_value@libnm_1_2_0 1.1.90 |
415 | + nm_lldp_neighbor_get_attr_type@libnm_1_2_0 1.1.90 |
416 | + nm_lldp_neighbor_get_attr_uint_value@libnm_1_2_0 1.1.90 |
417 | + nm_lldp_neighbor_get_type@libnm_1_2_0 1.1.90 |
418 | + nm_lldp_neighbor_new@libnm_1_2_0 1.1.90 |
419 | + nm_lldp_neighbor_ref@libnm_1_2_0 1.1.90 |
420 | + nm_lldp_neighbor_unref@libnm_1_2_0 1.1.90 |
421 | nm_manager_error_get_type@libnm_1_0_0 1.0.0 |
422 | nm_manager_error_quark@libnm_1_0_0 1.0.0 |
423 | + nm_metered_get_type@libnm_1_0_6 1.1.90 |
424 | + nm_metered_get_type@libnm_1_2_0 1.1.90 |
425 | nm_object_get_path@libnm_1_0_0 1.0.0 |
426 | nm_object_get_type@libnm_1_0_0 1.0.0 |
427 | nm_remote_connection_commit_changes@libnm_1_0_0 1.0.0 |
428 | @@ -352,6 +432,7 @@ |
429 | nm_setting_802_1x_add_altsubject_match@libnm_1_0_0 1.0.0 |
430 | nm_setting_802_1x_add_eap_method@libnm_1_0_0 1.0.0 |
431 | nm_setting_802_1x_add_phase2_altsubject_match@libnm_1_0_0 1.0.0 |
432 | + nm_setting_802_1x_check_cert_scheme@libnm_1_2_0 1.1.90 |
433 | nm_setting_802_1x_ck_format_get_type@libnm_1_0_0 1.0.0 |
434 | nm_setting_802_1x_ck_scheme_get_type@libnm_1_0_0 1.0.0 |
435 | nm_setting_802_1x_clear_altsubject_matches@libnm_1_0_0 1.0.0 |
436 | @@ -366,6 +447,7 @@ |
437 | nm_setting_802_1x_get_client_cert_blob@libnm_1_0_0 1.0.0 |
438 | nm_setting_802_1x_get_client_cert_path@libnm_1_0_0 1.0.0 |
439 | nm_setting_802_1x_get_client_cert_scheme@libnm_1_0_0 1.0.0 |
440 | + nm_setting_802_1x_get_domain_suffix_match@libnm_1_2_0 1.1.93 |
441 | nm_setting_802_1x_get_eap_method@libnm_1_0_0 1.0.0 |
442 | nm_setting_802_1x_get_identity@libnm_1_0_0 1.0.0 |
443 | nm_setting_802_1x_get_num_altsubject_matches@libnm_1_0_0 1.0.0 |
444 | @@ -389,6 +471,7 @@ |
445 | nm_setting_802_1x_get_phase2_client_cert_blob@libnm_1_0_0 1.0.0 |
446 | nm_setting_802_1x_get_phase2_client_cert_path@libnm_1_0_0 1.0.0 |
447 | nm_setting_802_1x_get_phase2_client_cert_scheme@libnm_1_0_0 1.0.0 |
448 | + nm_setting_802_1x_get_phase2_domain_suffix_match@libnm_1_2_0 1.1.93 |
449 | nm_setting_802_1x_get_phase2_private_key_blob@libnm_1_0_0 1.0.0 |
450 | nm_setting_802_1x_get_phase2_private_key_format@libnm_1_0_0 1.0.0 |
451 | nm_setting_802_1x_get_phase2_private_key_password@libnm_1_0_0 1.0.0 |
452 | @@ -448,6 +531,7 @@ |
453 | nm_setting_bridge_get_hello_time@libnm_1_0_0 1.0.0 |
454 | nm_setting_bridge_get_mac_address@libnm_1_0_0 1.0.0 |
455 | nm_setting_bridge_get_max_age@libnm_1_0_0 1.0.0 |
456 | + nm_setting_bridge_get_multicast_snooping@libnm_1_2_0 1.1.90 |
457 | nm_setting_bridge_get_priority@libnm_1_0_0 1.0.0 |
458 | nm_setting_bridge_get_stp@libnm_1_0_0 1.0.0 |
459 | nm_setting_bridge_get_type@libnm_1_0_0 1.0.0 |
460 | @@ -468,14 +552,19 @@ |
461 | nm_setting_connection_add_permission@libnm_1_0_0 1.0.0 |
462 | nm_setting_connection_add_secondary@libnm_1_0_0 1.0.0 |
463 | nm_setting_connection_autoconnect_slaves_get_type@libnm_1_0_4 1.0.4 |
464 | + nm_setting_connection_autoconnect_slaves_get_type@libnm_1_2_0 1.1.90 |
465 | nm_setting_connection_get_autoconnect@libnm_1_0_0 1.0.0 |
466 | nm_setting_connection_get_autoconnect_priority@libnm_1_0_0 1.0.0 |
467 | nm_setting_connection_get_autoconnect_slaves@libnm_1_0_4 1.0.4 |
468 | + nm_setting_connection_get_autoconnect_slaves@libnm_1_2_0 1.1.90 |
469 | nm_setting_connection_get_connection_type@libnm_1_0_0 1.0.0 |
470 | nm_setting_connection_get_gateway_ping_timeout@libnm_1_0_0 1.0.0 |
471 | nm_setting_connection_get_id@libnm_1_0_0 1.0.0 |
472 | nm_setting_connection_get_interface_name@libnm_1_0_0 1.0.0 |
473 | + nm_setting_connection_get_lldp@libnm_1_2_0 1.1.90 |
474 | nm_setting_connection_get_master@libnm_1_0_0 1.0.0 |
475 | + nm_setting_connection_get_metered@libnm_1_0_6 1.1.90 |
476 | + nm_setting_connection_get_metered@libnm_1_2_0 1.1.90 |
477 | nm_setting_connection_get_num_permissions@libnm_1_0_0 1.0.0 |
478 | nm_setting_connection_get_num_secondaries@libnm_1_0_0 1.0.0 |
479 | nm_setting_connection_get_permission@libnm_1_0_0 1.0.0 |
480 | @@ -487,6 +576,7 @@ |
481 | nm_setting_connection_get_uuid@libnm_1_0_0 1.0.0 |
482 | nm_setting_connection_get_zone@libnm_1_0_0 1.0.0 |
483 | nm_setting_connection_is_slave_type@libnm_1_0_0 1.0.0 |
484 | + nm_setting_connection_lldp_get_type@libnm_1_2_0 1.1.90 |
485 | nm_setting_connection_new@libnm_1_0_0 1.0.0 |
486 | nm_setting_connection_permissions_user_allowed@libnm_1_0_0 1.0.0 |
487 | nm_setting_connection_remove_permission@libnm_1_0_0 1.0.0 |
488 | @@ -528,6 +618,7 @@ |
489 | nm_setting_get_secret_flags@libnm_1_0_0 1.0.0 |
490 | nm_setting_get_type@libnm_1_0_0 1.0.0 |
491 | nm_setting_gsm_get_apn@libnm_1_0_0 1.0.0 |
492 | + nm_setting_gsm_get_device_id@libnm_1_2_0 1.1.90 |
493 | nm_setting_gsm_get_home_only@libnm_1_0_0 1.0.0 |
494 | nm_setting_gsm_get_network_id@libnm_1_0_0 1.0.0 |
495 | nm_setting_gsm_get_number@libnm_1_0_0 1.0.0 |
496 | @@ -535,6 +626,8 @@ |
497 | nm_setting_gsm_get_password_flags@libnm_1_0_0 1.0.0 |
498 | nm_setting_gsm_get_pin@libnm_1_0_0 1.0.0 |
499 | nm_setting_gsm_get_pin_flags@libnm_1_0_0 1.0.0 |
500 | + nm_setting_gsm_get_sim_id@libnm_1_2_0 1.1.90 |
501 | + nm_setting_gsm_get_sim_operator_id@libnm_1_2_0 1.1.90 |
502 | nm_setting_gsm_get_type@libnm_1_0_0 1.0.0 |
503 | nm_setting_gsm_get_username@libnm_1_0_0 1.0.0 |
504 | nm_setting_gsm_new@libnm_1_0_0 1.0.0 |
505 | @@ -547,24 +640,32 @@ |
506 | nm_setting_infiniband_get_virtual_interface_name@libnm_1_0_0 1.0.0 |
507 | nm_setting_infiniband_new@libnm_1_0_0 1.0.0 |
508 | nm_setting_ip4_config_get_dhcp_client_id@libnm_1_0_0 1.0.0 |
509 | + nm_setting_ip4_config_get_dhcp_fqdn@libnm_1_2_0 1.1.90 |
510 | nm_setting_ip4_config_get_type@libnm_1_0_0 1.0.0 |
511 | nm_setting_ip4_config_new@libnm_1_0_0 1.0.0 |
512 | + nm_setting_ip6_config_addr_gen_mode_get_type@libnm_1_2_0 1.1.90 |
513 | + nm_setting_ip6_config_get_addr_gen_mode@libnm_1_2_0 1.1.90 |
514 | nm_setting_ip6_config_get_ip6_privacy@libnm_1_0_0 1.0.0 |
515 | nm_setting_ip6_config_get_type@libnm_1_0_0 1.0.0 |
516 | nm_setting_ip6_config_new@libnm_1_0_0 1.0.0 |
517 | nm_setting_ip6_config_privacy_get_type@libnm_1_0_0 1.0.0 |
518 | nm_setting_ip_config_add_address@libnm_1_0_0 1.0.0 |
519 | nm_setting_ip_config_add_dns@libnm_1_0_0 1.0.0 |
520 | + nm_setting_ip_config_add_dns_option@libnm_1_2_0 1.1.90 |
521 | nm_setting_ip_config_add_dns_search@libnm_1_0_0 1.0.0 |
522 | nm_setting_ip_config_add_route@libnm_1_0_0 1.0.0 |
523 | nm_setting_ip_config_clear_addresses@libnm_1_0_0 1.0.0 |
524 | nm_setting_ip_config_clear_dns@libnm_1_0_0 1.0.0 |
525 | + nm_setting_ip_config_clear_dns_options@libnm_1_2_0 1.1.90 |
526 | nm_setting_ip_config_clear_dns_searches@libnm_1_0_0 1.0.0 |
527 | nm_setting_ip_config_clear_routes@libnm_1_0_0 1.0.0 |
528 | nm_setting_ip_config_get_address@libnm_1_0_0 1.0.0 |
529 | + nm_setting_ip_config_get_dad_timeout@libnm_1_2_0 1.1.91 |
530 | nm_setting_ip_config_get_dhcp_hostname@libnm_1_0_0 1.0.0 |
531 | nm_setting_ip_config_get_dhcp_send_hostname@libnm_1_0_0 1.0.0 |
532 | + nm_setting_ip_config_get_dhcp_timeout@libnm_1_2_0 1.1.91 |
533 | nm_setting_ip_config_get_dns@libnm_1_0_0 1.0.0 |
534 | + nm_setting_ip_config_get_dns_option@libnm_1_2_0 1.1.90 |
535 | nm_setting_ip_config_get_dns_search@libnm_1_0_0 1.0.0 |
536 | nm_setting_ip_config_get_gateway@libnm_1_0_0 1.0.0 |
537 | nm_setting_ip_config_get_ignore_auto_dns@libnm_1_0_0 1.0.0 |
538 | @@ -574,20 +675,44 @@ |
539 | nm_setting_ip_config_get_never_default@libnm_1_0_0 1.0.0 |
540 | nm_setting_ip_config_get_num_addresses@libnm_1_0_0 1.0.0 |
541 | nm_setting_ip_config_get_num_dns@libnm_1_0_0 1.0.0 |
542 | + nm_setting_ip_config_get_num_dns_options@libnm_1_2_0 1.1.90 |
543 | nm_setting_ip_config_get_num_dns_searches@libnm_1_0_0 1.0.0 |
544 | nm_setting_ip_config_get_num_routes@libnm_1_0_0 1.0.0 |
545 | nm_setting_ip_config_get_route@libnm_1_0_0 1.0.0 |
546 | nm_setting_ip_config_get_route_metric@libnm_1_0_0 1.0.0 |
547 | nm_setting_ip_config_get_type@libnm_1_0_0 1.0.0 |
548 | + nm_setting_ip_config_has_dns_options@libnm_1_2_0 1.1.90 |
549 | nm_setting_ip_config_remove_address@libnm_1_0_0 1.0.0 |
550 | nm_setting_ip_config_remove_address_by_value@libnm_1_0_0 1.0.0 |
551 | nm_setting_ip_config_remove_dns@libnm_1_0_0 1.0.0 |
552 | nm_setting_ip_config_remove_dns_by_value@libnm_1_0_0 1.0.0 |
553 | + nm_setting_ip_config_remove_dns_option@libnm_1_2_0 1.1.90 |
554 | + nm_setting_ip_config_remove_dns_option_by_value@libnm_1_2_0 1.1.93 |
555 | nm_setting_ip_config_remove_dns_search@libnm_1_0_0 1.0.0 |
556 | nm_setting_ip_config_remove_dns_search_by_value@libnm_1_0_0 1.0.0 |
557 | nm_setting_ip_config_remove_route@libnm_1_0_0 1.0.0 |
558 | nm_setting_ip_config_remove_route_by_value@libnm_1_0_0 1.0.0 |
559 | + nm_setting_ip_tunnel_get_input_key@libnm_1_2_0 1.1.90 |
560 | + nm_setting_ip_tunnel_get_local@libnm_1_2_0 1.1.90 |
561 | + nm_setting_ip_tunnel_get_mode@libnm_1_2_0 1.1.90 |
562 | + nm_setting_ip_tunnel_get_mtu@libnm_1_2_0 1.1.90 |
563 | + nm_setting_ip_tunnel_get_output_key@libnm_1_2_0 1.1.90 |
564 | + nm_setting_ip_tunnel_get_parent@libnm_1_2_0 1.1.90 |
565 | + nm_setting_ip_tunnel_get_path_mtu_discovery@libnm_1_2_0 1.1.90 |
566 | + nm_setting_ip_tunnel_get_remote@libnm_1_2_0 1.1.90 |
567 | + nm_setting_ip_tunnel_get_tos@libnm_1_2_0 1.1.90 |
568 | + nm_setting_ip_tunnel_get_ttl@libnm_1_2_0 1.1.90 |
569 | + nm_setting_ip_tunnel_get_type@libnm_1_2_0 1.1.90 |
570 | + nm_setting_ip_tunnel_new@libnm_1_2_0 1.1.90 |
571 | nm_setting_lookup_type@libnm_1_0_0 1.0.0 |
572 | + nm_setting_mac_randomization_get_type@libnm_1_2_0 1.1.90 |
573 | + nm_setting_macvlan_get_mode@libnm_1_2_0 1.1.90 |
574 | + nm_setting_macvlan_get_parent@libnm_1_2_0 1.1.90 |
575 | + nm_setting_macvlan_get_promiscuous@libnm_1_2_0 1.1.90 |
576 | + nm_setting_macvlan_get_tap@libnm_1_2_0 1.1.90 |
577 | + nm_setting_macvlan_get_type@libnm_1_2_0 1.1.90 |
578 | + nm_setting_macvlan_mode_get_type@libnm_1_2_0 1.1.90 |
579 | + nm_setting_macvlan_new@libnm_1_2_0 1.1.90 |
580 | nm_setting_olpc_mesh_get_channel@libnm_1_0_0 1.0.0 |
581 | nm_setting_olpc_mesh_get_dhcp_anycast_address@libnm_1_0_0 1.0.0 |
582 | nm_setting_olpc_mesh_get_ssid@libnm_1_0_0 1.0.0 |
583 | @@ -636,7 +761,17 @@ |
584 | nm_setting_team_port_get_type@libnm_1_0_0 1.0.0 |
585 | nm_setting_team_port_new@libnm_1_0_0 1.0.0 |
586 | nm_setting_to_string@libnm_1_0_0 1.0.0 |
587 | + nm_setting_tun_get_group@libnm_1_2_0 1.1.90 |
588 | + nm_setting_tun_get_mode@libnm_1_2_0 1.1.90 |
589 | + nm_setting_tun_get_multi_queue@libnm_1_2_0 1.1.90 |
590 | + nm_setting_tun_get_owner@libnm_1_2_0 1.1.90 |
591 | + nm_setting_tun_get_pi@libnm_1_2_0 1.1.90 |
592 | + nm_setting_tun_get_type@libnm_1_2_0 1.1.90 |
593 | + nm_setting_tun_get_vnet_hdr@libnm_1_2_0 1.1.90 |
594 | + nm_setting_tun_mode_get_type@libnm_1_2_0 1.1.90 |
595 | + nm_setting_tun_new@libnm_1_2_0 1.1.90 |
596 | nm_setting_verify@libnm_1_0_0 1.0.0 |
597 | + nm_setting_verify_secrets@libnm_1_2_0 1.1.90 |
598 | nm_setting_vlan_add_priority@libnm_1_0_0 1.0.0 |
599 | nm_setting_vlan_add_priority_str@libnm_1_0_0 1.0.0 |
600 | nm_setting_vlan_clear_priorities@libnm_1_0_0 1.0.0 |
601 | @@ -659,11 +794,30 @@ |
602 | nm_setting_vpn_get_num_secrets@libnm_1_0_0 1.0.0 |
603 | nm_setting_vpn_get_secret@libnm_1_0_0 1.0.0 |
604 | nm_setting_vpn_get_service_type@libnm_1_0_0 1.0.0 |
605 | + nm_setting_vpn_get_timeout@libnm_1_2_0 1.1.90 |
606 | nm_setting_vpn_get_type@libnm_1_0_0 1.0.0 |
607 | nm_setting_vpn_get_user_name@libnm_1_0_0 1.0.0 |
608 | nm_setting_vpn_new@libnm_1_0_0 1.0.0 |
609 | nm_setting_vpn_remove_data_item@libnm_1_0_0 1.0.0 |
610 | nm_setting_vpn_remove_secret@libnm_1_0_0 1.0.0 |
611 | + nm_setting_vxlan_get_ageing@libnm_1_2_0 1.1.90 |
612 | + nm_setting_vxlan_get_destination_port@libnm_1_2_0 1.1.90 |
613 | + nm_setting_vxlan_get_id@libnm_1_2_0 1.1.90 |
614 | + nm_setting_vxlan_get_l2_miss@libnm_1_2_0 1.1.90 |
615 | + nm_setting_vxlan_get_l3_miss@libnm_1_2_0 1.1.90 |
616 | + nm_setting_vxlan_get_learning@libnm_1_2_0 1.1.90 |
617 | + nm_setting_vxlan_get_limit@libnm_1_2_0 1.1.90 |
618 | + nm_setting_vxlan_get_local@libnm_1_2_0 1.1.90 |
619 | + nm_setting_vxlan_get_parent@libnm_1_2_0 1.1.90 |
620 | + nm_setting_vxlan_get_proxy@libnm_1_2_0 1.1.90 |
621 | + nm_setting_vxlan_get_remote@libnm_1_2_0 1.1.90 |
622 | + nm_setting_vxlan_get_rsc@libnm_1_2_0 1.1.90 |
623 | + nm_setting_vxlan_get_source_port_max@libnm_1_2_0 1.1.90 |
624 | + nm_setting_vxlan_get_source_port_min@libnm_1_2_0 1.1.90 |
625 | + nm_setting_vxlan_get_tos@libnm_1_2_0 1.1.90 |
626 | + nm_setting_vxlan_get_ttl@libnm_1_2_0 1.1.90 |
627 | + nm_setting_vxlan_get_type@libnm_1_2_0 1.1.90 |
628 | + nm_setting_vxlan_new@libnm_1_2_0 1.1.90 |
629 | nm_setting_wimax_get_mac_address@libnm_1_0_0 1.0.0 |
630 | nm_setting_wimax_get_network_name@libnm_1_0_0 1.0.0 |
631 | nm_setting_wimax_get_type@libnm_1_0_0 1.0.0 |
632 | @@ -688,10 +842,16 @@ |
633 | nm_setting_wired_get_speed@libnm_1_0_0 1.0.0 |
634 | nm_setting_wired_get_type@libnm_1_0_0 1.0.0 |
635 | nm_setting_wired_get_valid_s390_options@libnm_1_0_0 1.0.0 |
636 | + nm_setting_wired_get_wake_on_lan@libnm_1_0_6 1.1.90 |
637 | + nm_setting_wired_get_wake_on_lan@libnm_1_2_0 1.1.90 |
638 | + nm_setting_wired_get_wake_on_lan_password@libnm_1_0_6 1.1.90 |
639 | + nm_setting_wired_get_wake_on_lan_password@libnm_1_2_0 1.1.90 |
640 | nm_setting_wired_new@libnm_1_0_0 1.0.0 |
641 | nm_setting_wired_remove_mac_blacklist_item@libnm_1_0_0 1.0.0 |
642 | nm_setting_wired_remove_mac_blacklist_item_by_value@libnm_1_0_0 1.0.0 |
643 | nm_setting_wired_remove_s390_option@libnm_1_0_0 1.0.0 |
644 | + nm_setting_wired_wake_on_lan_get_type@libnm_1_0_6 1.1.90 |
645 | + nm_setting_wired_wake_on_lan_get_type@libnm_1_2_0 1.1.90 |
646 | nm_setting_wireless_add_mac_blacklist_item@libnm_1_0_0 1.0.0 |
647 | nm_setting_wireless_add_seen_bssid@libnm_1_0_0 1.0.0 |
648 | nm_setting_wireless_ap_security_compatible@libnm_1_0_0 1.0.0 |
649 | @@ -703,17 +863,20 @@ |
650 | nm_setting_wireless_get_hidden@libnm_1_0_0 1.0.0 |
651 | nm_setting_wireless_get_mac_address@libnm_1_0_0 1.0.0 |
652 | nm_setting_wireless_get_mac_address_blacklist@libnm_1_0_0 1.0.0 |
653 | + nm_setting_wireless_get_mac_address_randomization@libnm_1_2_0 1.1.90 |
654 | nm_setting_wireless_get_mac_blacklist_item@libnm_1_0_0 1.0.0 |
655 | nm_setting_wireless_get_mode@libnm_1_0_0 1.0.0 |
656 | nm_setting_wireless_get_mtu@libnm_1_0_0 1.0.0 |
657 | nm_setting_wireless_get_num_mac_blacklist_items@libnm_1_0_0 1.0.0 |
658 | nm_setting_wireless_get_num_seen_bssids@libnm_1_0_0 1.0.0 |
659 | + nm_setting_wireless_get_powersave@libnm_1_2_0 1.1.90 |
660 | nm_setting_wireless_get_rate@libnm_1_0_0 1.0.0 |
661 | nm_setting_wireless_get_seen_bssid@libnm_1_0_0 1.0.0 |
662 | nm_setting_wireless_get_ssid@libnm_1_0_0 1.0.0 |
663 | nm_setting_wireless_get_tx_power@libnm_1_0_0 1.0.0 |
664 | nm_setting_wireless_get_type@libnm_1_0_0 1.0.0 |
665 | nm_setting_wireless_new@libnm_1_0_0 1.0.0 |
666 | + nm_setting_wireless_powersave_get_type@libnm_1_2_0 1.1.91 |
667 | nm_setting_wireless_remove_mac_blacklist_item@libnm_1_0_0 1.0.0 |
668 | nm_setting_wireless_remove_mac_blacklist_item_by_value@libnm_1_0_0 1.0.0 |
669 | nm_setting_wireless_security_add_group@libnm_1_0_0 1.0.0 |
670 | @@ -757,7 +920,14 @@ |
671 | nm_state_get_type@libnm_1_0_0 1.0.0 |
672 | nm_utils_ap_mode_security_valid@libnm_1_0_0 1.0.0 |
673 | nm_utils_bin2hexstr@libnm_1_0_0 1.0.0 |
674 | + nm_utils_bond_mode_int_to_string@libnm_1_2_0 1.1.90 |
675 | + nm_utils_bond_mode_string_to_int@libnm_1_2_0 1.1.90 |
676 | nm_utils_check_virtual_device_compatibility@libnm_1_0_0 1.0.0 |
677 | + nm_utils_enum_from_str@libnm_1_0_6 1.1.90 |
678 | + nm_utils_enum_from_str@libnm_1_2_0 1.1.90 |
679 | + nm_utils_enum_get_values@libnm_1_2_0 1.1.90 |
680 | + nm_utils_enum_to_str@libnm_1_0_6 1.1.90 |
681 | + nm_utils_enum_to_str@libnm_1_2_0 1.1.90 |
682 | nm_utils_escape_ssid@libnm_1_0_0 1.0.0 |
683 | nm_utils_file_is_certificate@libnm_1_0_0 1.0.0 |
684 | nm_utils_file_is_pkcs12@libnm_1_0_0 1.0.0 |
685 | @@ -798,6 +968,10 @@ |
686 | nm_utils_ssid_to_utf8@libnm_1_0_0 1.0.0 |
687 | nm_utils_uuid_generate@libnm_1_0_0 1.0.0 |
688 | nm_utils_wep_key_valid@libnm_1_0_0 1.0.0 |
689 | + nm_utils_wifi_2ghz_freqs@libnm_1_0_6 1.1.90 |
690 | + nm_utils_wifi_2ghz_freqs@libnm_1_2_0 1.1.90 |
691 | + nm_utils_wifi_5ghz_freqs@libnm_1_0_6 1.1.90 |
692 | + nm_utils_wifi_5ghz_freqs@libnm_1_2_0 1.1.90 |
693 | nm_utils_wifi_channel_to_freq@libnm_1_0_0 1.0.0 |
694 | nm_utils_wifi_find_next_channel@libnm_1_0_0 1.0.0 |
695 | nm_utils_wifi_freq_to_channel@libnm_1_0_0 1.0.0 |
696 | @@ -820,21 +994,51 @@ |
697 | nm_vpn_editor_plugin_get_suggested_filename@libnm_1_0_0 1.0.0 |
698 | nm_vpn_editor_plugin_get_type@libnm_1_0_0 1.0.0 |
699 | nm_vpn_editor_plugin_import@libnm_1_0_0 1.0.0 |
700 | + nm_vpn_editor_plugin_load_from_file@libnm_1_2_0 1.1.90 |
701 | nm_vpn_editor_update_connection@libnm_1_0_0 1.0.0 |
702 | nm_vpn_plugin_error_get_type@libnm_1_0_0 1.0.0 |
703 | nm_vpn_plugin_error_quark@libnm_1_0_0 1.0.0 |
704 | nm_vpn_plugin_failure_get_type@libnm_1_0_0 1.0.0 |
705 | - nm_vpn_plugin_old_disconnect@libnm_1_0_0 1.0.0 |
706 | - nm_vpn_plugin_old_failure@libnm_1_0_0 1.0.0 |
707 | - nm_vpn_plugin_old_get_connection@libnm_1_0_0 1.0.0 |
708 | - nm_vpn_plugin_old_get_secret_flags@libnm_1_0_0 1.0.0 |
709 | - nm_vpn_plugin_old_get_state@libnm_1_0_0 1.0.0 |
710 | - nm_vpn_plugin_old_get_type@libnm_1_0_0 1.0.0 |
711 | - nm_vpn_plugin_old_read_vpn_details@libnm_1_0_0 1.0.0 |
712 | - nm_vpn_plugin_old_secrets_required@libnm_1_0_0 1.0.0 |
713 | - nm_vpn_plugin_old_set_ip4_config@libnm_1_0_0 1.0.0 |
714 | - nm_vpn_plugin_old_set_login_banner@libnm_1_0_0 1.0.0 |
715 | - nm_vpn_plugin_old_set_state@libnm_1_0_0 1.0.0 |
716 | + nm_vpn_plugin_info_get_editor_plugin@libnm_1_2_0 1.1.90 |
717 | + nm_vpn_plugin_info_get_filename@libnm_1_2_0 1.1.90 |
718 | + nm_vpn_plugin_info_get_name@libnm_1_2_0 1.1.90 |
719 | + nm_vpn_plugin_info_get_plugin@libnm_1_2_0 1.1.90 |
720 | + nm_vpn_plugin_info_get_program@libnm_1_2_0 1.1.90 |
721 | + nm_vpn_plugin_info_get_type@libnm_1_2_0 1.1.90 |
722 | + nm_vpn_plugin_info_list_add@libnm_1_2_0 1.1.90 |
723 | + nm_vpn_plugin_info_list_find_by_filename@libnm_1_2_0 1.1.90 |
724 | + nm_vpn_plugin_info_list_find_by_name@libnm_1_2_0 1.1.90 |
725 | + nm_vpn_plugin_info_list_find_by_service@libnm_1_2_0 1.1.90 |
726 | + nm_vpn_plugin_info_list_load@libnm_1_2_0 1.1.90 |
727 | + nm_vpn_plugin_info_list_remove@libnm_1_2_0 1.1.90 |
728 | + nm_vpn_plugin_info_load_editor_plugin@libnm_1_2_0 1.1.90 |
729 | + nm_vpn_plugin_info_lookup_property@libnm_1_2_0 1.1.90 |
730 | + nm_vpn_plugin_info_new_from_file@libnm_1_2_0 1.1.90 |
731 | + nm_vpn_plugin_info_new_with_data@libnm_1_2_0 1.1.90 |
732 | + nm_vpn_plugin_info_set_editor_plugin@libnm_1_2_0 1.1.90 |
733 | + nm_vpn_plugin_info_validate_filename@libnm_1_2_0 1.1.90 |
734 | + nm_vpn_plugin_old_disconnect@libnm_1_0_0 1.1.91 |
735 | + nm_vpn_plugin_old_failure@libnm_1_0_0 1.1.91 |
736 | + nm_vpn_plugin_old_get_connection@libnm_1_0_0 1.1.91 |
737 | + nm_vpn_plugin_old_get_secret_flags@libnm_1_0_0 1.1.91 |
738 | + nm_vpn_plugin_old_get_state@libnm_1_0_0 1.1.91 |
739 | + nm_vpn_plugin_old_get_type@libnm_1_0_0 1.1.91 |
740 | + nm_vpn_plugin_old_read_vpn_details@libnm_1_0_0 1.1.91 |
741 | + nm_vpn_plugin_old_secrets_required@libnm_1_0_0 1.1.91 |
742 | + nm_vpn_plugin_old_set_ip4_config@libnm_1_0_0 1.1.91 |
743 | + nm_vpn_plugin_old_set_login_banner@libnm_1_0_0 1.1.91 |
744 | + nm_vpn_plugin_old_set_state@libnm_1_0_0 1.1.91 |
745 | + nm_vpn_service_plugin_disconnect@libnm_1_2_0 1.1.90 |
746 | + nm_vpn_service_plugin_failure@libnm_1_2_0 1.1.90 |
747 | + nm_vpn_service_plugin_get_connection@libnm_1_2_0 1.1.90 |
748 | + nm_vpn_service_plugin_get_secret_flags@libnm_1_2_0 1.1.90 |
749 | + nm_vpn_service_plugin_get_type@libnm_1_2_0 1.1.90 |
750 | + nm_vpn_service_plugin_read_vpn_details@libnm_1_2_0 1.1.90 |
751 | + nm_vpn_service_plugin_secrets_required@libnm_1_2_0 1.1.90 |
752 | + nm_vpn_service_plugin_set_config@libnm_1_2_0 1.1.90 |
753 | + nm_vpn_service_plugin_set_ip4_config@libnm_1_2_0 1.1.90 |
754 | + nm_vpn_service_plugin_set_ip6_config@libnm_1_2_0 1.1.90 |
755 | + nm_vpn_service_plugin_set_login_banner@libnm_1_2_0 1.1.90 |
756 | nm_vpn_service_state_get_type@libnm_1_0_0 1.0.0 |
757 | nm_wep_key_type_get_type@libnm_1_0_0 1.0.0 |
758 | nm_wimax_nsp_connection_valid@libnm_1_0_0 1.0.0 |
759 | |
760 | === modified file 'debian/network-manager-dev.install' |
761 | --- debian/network-manager-dev.install 2014-11-05 05:47:49 +0000 |
762 | +++ debian/network-manager-dev.install 2016-04-08 14:51:24 +0000 |
763 | @@ -2,4 +2,5 @@ |
764 | usr/include/NetworkManager/NetworkManager.h |
765 | usr/include/NetworkManager/NetworkManagerVPN.h |
766 | usr/include/NetworkManager/nm-version.h |
767 | +usr/include/NetworkManager/nm-version-macros.h |
768 | usr/share/gtk-doc/html/NetworkManager/ |
769 | |
770 | === modified file 'debian/network-manager.dirs' |
771 | --- debian/network-manager.dirs 2014-11-05 05:47:49 +0000 |
772 | +++ debian/network-manager.dirs 2016-04-08 14:51:24 +0000 |
773 | @@ -1,5 +1,6 @@ |
774 | var/lib/NetworkManager/ |
775 | etc/NetworkManager/conf.d/ |
776 | +etc/NetworkManager/dnsmasq.d/ |
777 | +etc/NetworkManager/dnsmasq-shared.d/ |
778 | etc/NetworkManager/system-connections/ |
779 | etc/NetworkManager/VPN/ |
780 | -etc/NetworkManager/dnsmasq.d/ |
781 | |
782 | === modified file 'debian/network-manager.install' |
783 | --- debian/network-manager.install 2015-09-25 20:29:52 +0000 |
784 | +++ debian/network-manager.install 2016-04-08 14:51:24 +0000 |
785 | @@ -5,13 +5,13 @@ |
786 | usr/lib/NetworkManager/nm-dhcp-helper |
787 | usr/lib/NetworkManager/nm-iface-helper |
788 | usr/lib/NetworkManager/nm-dispatcher |
789 | -usr/lib/NetworkManager/nm-avahi-autoipd.action |
790 | usr/lib/*/NetworkManager/libnm-settings-plugin-ifupdown.so |
791 | usr/lib/*/NetworkManager/libnm-settings-plugin-ibft.so |
792 | usr/lib/*/NetworkManager/libnm-settings-plugin-ofono.so |
793 | usr/lib/*/NetworkManager/libnm-device-plugin-*.so |
794 | usr/lib/*/NetworkManager/libnm-wwan.so |
795 | usr/lib/pppd/*/*.so |
796 | +usr/share/doc/NetworkManager/examples/ |
797 | usr/share/locale/ |
798 | usr/share/man/ |
799 | usr/share/dbus-1/system-services/ |
800 | @@ -19,7 +19,6 @@ |
801 | usr/share/bash-completion/ |
802 | etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf |
803 | etc/dbus-1/system.d/nm-dispatcher.conf |
804 | -etc/dbus-1/system.d/nm-avahi-autoipd.conf |
805 | etc/NetworkManager/dispatcher.d/ |
806 | lib/udev/rules.d/*.rules |
807 | lib/systemd/system/NetworkManager.service |
808 | |
809 | === modified file 'debian/network-manager.maintscript' |
810 | --- debian/network-manager.maintscript 2014-11-05 05:47:49 +0000 |
811 | +++ debian/network-manager.maintscript 2016-04-08 14:51:24 +0000 |
812 | @@ -1,4 +1,5 @@ |
813 | -mv_conffile /etc/dbus-1/system.d/NetworkManager.conf /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf 0.9.4.0-1~ network-manager |
814 | -rm_conffile /etc/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla 0.9.8.8-4~ network-manager |
815 | -rm_conffile /etc/polkit-1/rules.d/60-network-manager.rules 0.9.8.8-4~ network-manager |
816 | -rm_conffile /etc/dbus-1/system.d/nm-dhcp-client.conf 0.9.10.0-1~ network-manager |
817 | +mv_conffile /etc/dbus-1/system.d/NetworkManager.conf /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf 0.9.4.0-1~ |
818 | +rm_conffile /etc/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla 0.9.8.8-4~ |
819 | +rm_conffile /etc/polkit-1/rules.d/60-network-manager.rules 0.9.8.8-4~ |
820 | +rm_conffile /etc/dbus-1/system.d/nm-dhcp-client.conf 0.9.10.0-1~ |
821 | +rm_conffile /etc/dbus-1/system.d/nm-avahi-autoipd.conf 1.1.90-2~ |
822 | |
823 | === removed file 'debian/network-manager.upstart' |
824 | --- debian/network-manager.upstart 2012-05-22 22:09:44 +0000 |
825 | +++ debian/network-manager.upstart 1970-01-01 00:00:00 +0000 |
826 | @@ -1,24 +0,0 @@ |
827 | -# network-manager - network connection manager |
828 | -# |
829 | -# The Network Manager daemon manages the system's network connections, |
830 | -# automatically switching between the best available. |
831 | - |
832 | -description "network connection manager" |
833 | - |
834 | -start on (local-filesystems |
835 | - and started dbus |
836 | - and static-network-up) |
837 | -stop on stopping dbus |
838 | - |
839 | -expect fork |
840 | -respawn |
841 | - |
842 | -script |
843 | - # set $LANG so that messages appearing on the GUI will be translated. See LP: 875017 |
844 | - if [ -r /etc/default/locale ]; then |
845 | - . /etc/default/locale |
846 | - export LANG LANGUAGE LC_MESSAGES LC_ALL |
847 | - fi |
848 | - |
849 | - exec NetworkManager |
850 | -end script |
851 | |
852 | === removed file 'debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch' |
853 | --- debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch 2014-11-05 05:47:49 +0000 |
854 | +++ debian/patches/0001-Debian-specific-tweaks-for-NetworkManager-systemd-se.patch 1970-01-01 00:00:00 +0000 |
855 | @@ -1,33 +0,0 @@ |
856 | -From: Michael Biebl <biebl@debian.org> |
857 | -Date: Wed, 2 Apr 2014 03:15:53 +0200 |
858 | -Subject: Debian specific tweaks for NetworkManager systemd service file |
859 | - |
860 | -This patch is needed to avoid a dependency loop which is generated |
861 | -by early boot (rcS) SysV init scripts depending on the $network LSB |
862 | -system facility (either directly or indirectly via $remote_fs). |
863 | - |
864 | -The $network LSB system facility is mapped to network.target. |
865 | - |
866 | -Those rcS SysV init scripts are started in sysinit.target, |
867 | -NetworkManager.service is started via multi-user.target, which depends |
868 | -on sysinit.target. |
869 | - |
870 | -As long as we have rcS SysV init scripts which such a dependency on |
871 | -$remote_fs or $network we can not make NetworkManager.service a provider |
872 | -for network.target. |
873 | ---- |
874 | - data/NetworkManager.service.in | 2 -- |
875 | - 1 file changed, 2 deletions(-) |
876 | - |
877 | -diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in |
878 | -index 84a9c95..2fb510f 100644 |
879 | ---- a/data/NetworkManager.service.in |
880 | -+++ b/data/NetworkManager.service.in |
881 | -@@ -1,7 +1,5 @@ |
882 | - [Unit] |
883 | - Description=Network Manager |
884 | --Wants=network.target |
885 | --Before=network.target @DISTRO_NETWORK_SERVICE@ |
886 | - |
887 | - [Service] |
888 | - Type=dbus |
889 | |
890 | === modified file 'debian/patches/0001-dns-use-DBus-to-make-dnsmasq-nameserver-changes.patch' |
891 | --- debian/patches/0001-dns-use-DBus-to-make-dnsmasq-nameserver-changes.patch 2015-08-20 01:07:00 +0000 |
892 | +++ debian/patches/0001-dns-use-DBus-to-make-dnsmasq-nameserver-changes.patch 2016-04-08 14:51:24 +0000 |
893 | @@ -8,488 +8,522 @@ |
894 | |
895 | Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
896 | --- |
897 | - src/dns-manager/nm-dns-dnsmasq.c | 310 ++++++++++++++++++++++---------- |
898 | - src/dns-manager/nm-dns-manager.c | 22 ++ |
899 | - src/dns-manager/nm-dns-plugin.c | 16 + |
900 | + src/dns-manager/nm-dns-dnsmasq.c | 344 +++++++++++++++++++++++--------- |
901 | + src/dns-manager/nm-dns-manager.c | 19 + |
902 | + src/dns-manager/nm-dns-plugin.c | 18 + |
903 | src/dns-manager/nm-dns-plugin.h | 1 |
904 | - src/org.freedesktop.NetworkManager.conf | 10 + |
905 | - 5 files changed, 271 insertions(+), 88 deletions(-) |
906 | + src/org.freedesktop.NetworkManager.conf | 10 |
907 | + 5 files changed, 304 insertions(+), 88 deletions(-) |
908 | |
909 | Index: b/src/dns-manager/nm-dns-dnsmasq.c |
910 | =================================================================== |
911 | --- a/src/dns-manager/nm-dns-dnsmasq.c |
912 | +++ b/src/dns-manager/nm-dns-dnsmasq.c |
913 | -@@ -27,6 +27,10 @@ |
914 | - #include <arpa/inet.h> |
915 | - #include <sys/stat.h> |
916 | - |
917 | -+#include <dbus/dbus.h> |
918 | -+#include <dbus/dbus-glib-lowlevel.h> |
919 | -+#include <dbus/dbus-glib.h> |
920 | -+ |
921 | - #include <glib.h> |
922 | - #include <glib/gi18n.h> |
923 | - |
924 | -@@ -37,6 +41,7 @@ |
925 | +@@ -32,6 +32,7 @@ |
926 | + #include "nm-ip4-config.h" |
927 | #include "nm-ip6-config.h" |
928 | #include "nm-dns-utils.h" |
929 | ++#include "nm-bus-manager.h" |
930 | #include "NetworkManagerUtils.h" |
931 | -+#include "nm-dbus-manager.h" |
932 | |
933 | G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsmasq, NM_TYPE_DNS_PLUGIN) |
934 | +@@ -39,11 +40,17 @@ G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsm |
935 | + #define NM_DNS_DNSMASQ_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_DNSMASQ, NMDnsDnsmasqPrivate)) |
936 | |
937 | -@@ -46,14 +51,19 @@ G_DEFINE_TYPE (NMDnsDnsmasq, nm_dns_dnsm |
938 | - #define CONFFILE NMRUNDIR "/dnsmasq.conf" |
939 | + #define PIDFILE NMRUNDIR "/dnsmasq.pid" |
940 | +-#define CONFFILE NMRUNDIR "/dnsmasq.conf" |
941 | #define CONFDIR NMCONFDIR "/dnsmasq.d" |
942 | |
943 | +#define DNSMASQ_DBUS_SERVICE "org.freedesktop.NetworkManager.dnsmasq" |
944 | +#define DNSMASQ_DBUS_PATH "/uk/org/thekelleys/dnsmasq" |
945 | -+#define DNSMASQ_DBUS_INTERFACE "uk.org.thekelleys.dnsmasq" |
946 | + |
947 | typedef struct { |
948 | - guint32 foo; |
949 | -+ NMDBusManager *dbus_mgr; |
950 | -+ guint name_owner_id; |
951 | ++ GDBusProxy *dnsmasq; |
952 | ++ GCancellable *dnsmasq_cancellable; |
953 | ++ gboolean running; |
954 | ++ |
955 | ++ GVariant *set_servers_ex_args; |
956 | } NMDnsDnsmasqPrivate; |
957 | |
958 | - /*******************************************/ |
959 | - |
960 | + /*****************************************************************************/ |
961 | +@@ -61,8 +68,28 @@ typedef struct { |
962 | + |
963 | + /*****************************************************************************/ |
964 | + |
965 | ++static void |
966 | ++add_dnsmasq_nameserver (NMDnsDnsmasq *self, |
967 | ++ GVariantBuilder *servers, |
968 | ++ const char *ip, |
969 | ++ const char *domain) |
970 | ++{ |
971 | ++ g_return_if_fail (ip); |
972 | ++ |
973 | ++ _LOGD ("adding nameserver '%s' for domain '%s'", |
974 | ++ ip, domain); |
975 | ++ |
976 | ++ g_variant_builder_open (servers, G_VARIANT_TYPE ("as")); |
977 | ++ |
978 | ++ g_variant_builder_add (servers, "s", ip); |
979 | ++ if (domain) |
980 | ++ g_variant_builder_add (servers, "s", domain); |
981 | ++ |
982 | ++ g_variant_builder_close (servers); |
983 | ++} |
984 | ++ |
985 | static gboolean |
986 | -add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split) |
987 | -+add_ip4_config (DBusMessage *message, NMIP4Config *ip4, gboolean split) |
988 | ++add_ip4_config (NMDnsDnsmasq *self, GVariantBuilder *servers, NMIP4Config *ip4, gboolean split) |
989 | { |
990 | char buf[INET_ADDRSTRLEN]; |
991 | in_addr_t addr; |
992 | -@@ -69,15 +79,18 @@ add_ip4_config (GString *str, NMIP4Confi |
993 | - return FALSE; |
994 | - |
995 | - for (i_nameserver = 0; i_nameserver < nnameservers; i_nameserver++) { |
996 | -- addr = nm_ip4_config_get_nameserver (ip4, i_nameserver); |
997 | -- nm_utils_inet4_ntop (addr, buf); |
998 | -+ addr = g_htonl(nm_ip4_config_get_nameserver (ip4, i_nameserver)); |
999 | -+ dbus_message_append_args (message, |
1000 | -+ DBUS_TYPE_UINT32, &addr, |
1001 | -+ DBUS_TYPE_INVALID); |
1002 | - |
1003 | +@@ -84,9 +111,10 @@ add_ip4_config (GString *str, NMIP4Confi |
1004 | /* searches are preferred over domains */ |
1005 | n = nm_ip4_config_get_num_searches (ip4); |
1006 | for (i = 0; i < n; i++) { |
1007 | - g_string_append_printf (str, "server=/%s/%s\n", |
1008 | - nm_ip4_config_get_search (ip4, i), |
1009 | - buf); |
1010 | -+ char *search = nm_ip4_config_get_search (ip4, i); |
1011 | -+ dbus_message_append_args (message, |
1012 | -+ DBUS_TYPE_STRING, &search, |
1013 | -+ DBUS_TYPE_INVALID); |
1014 | ++ add_dnsmasq_nameserver (self, |
1015 | ++ servers, |
1016 | ++ buf, |
1017 | ++ nm_ip4_config_get_search (ip4, i)); |
1018 | added = TRUE; |
1019 | } |
1020 | |
1021 | -@@ -85,9 +98,10 @@ add_ip4_config (GString *str, NMIP4Confi |
1022 | +@@ -94,9 +122,10 @@ add_ip4_config (GString *str, NMIP4Confi |
1023 | /* If not searches, use any domains */ |
1024 | n = nm_ip4_config_get_num_domains (ip4); |
1025 | for (i = 0; i < n; i++) { |
1026 | - g_string_append_printf (str, "server=/%s/%s\n", |
1027 | - nm_ip4_config_get_domain (ip4, i), |
1028 | - buf); |
1029 | -+ char *domain = nm_ip4_config_get_domain (ip4, i); |
1030 | -+ dbus_message_append_args (message, |
1031 | -+ DBUS_TYPE_STRING, &domain, |
1032 | -+ DBUS_TYPE_INVALID); |
1033 | ++ add_dnsmasq_nameserver (self, |
1034 | ++ servers, |
1035 | ++ buf, |
1036 | ++ nm_ip4_config_get_domain (ip4, i)); |
1037 | added = TRUE; |
1038 | } |
1039 | } |
1040 | -@@ -98,7 +112,9 @@ add_ip4_config (GString *str, NMIP4Confi |
1041 | +@@ -107,7 +136,7 @@ add_ip4_config (GString *str, NMIP4Confi |
1042 | domains = nm_dns_utils_get_ip4_rdns_domains (ip4); |
1043 | if (domains) { |
1044 | for (iter = domains; iter && *iter; iter++) |
1045 | - g_string_append_printf (str, "server=/%s/%s\n", *iter, buf); |
1046 | -+ dbus_message_append_args (message, |
1047 | -+ DBUS_TYPE_STRING, &(*iter), |
1048 | -+ DBUS_TYPE_INVALID); |
1049 | ++ add_dnsmasq_nameserver (self, servers, buf, *iter); |
1050 | g_strfreev (domains); |
1051 | added = TRUE; |
1052 | } |
1053 | -@@ -108,41 +124,20 @@ add_ip4_config (GString *str, NMIP4Confi |
1054 | - /* If no searches or domains, just add the namservers */ |
1055 | +@@ -118,7 +147,8 @@ add_ip4_config (GString *str, NMIP4Confi |
1056 | if (!added) { |
1057 | for (i = 0; i < nnameservers; i++) { |
1058 | -- addr = nm_ip4_config_get_nameserver (ip4, i); |
1059 | + addr = nm_ip4_config_get_nameserver (ip4, i); |
1060 | - g_string_append_printf (str, "server=%s\n", nm_utils_inet4_ntop (addr, NULL)); |
1061 | -+ addr = g_htonl (nm_ip4_config_get_nameserver (ip4, i)); |
1062 | -+ dbus_message_append_args (message, |
1063 | -+ DBUS_TYPE_UINT32, &addr, |
1064 | -+ DBUS_TYPE_INVALID); |
1065 | - } |
1066 | - } |
1067 | - |
1068 | - return TRUE; |
1069 | - } |
1070 | - |
1071 | --static char * |
1072 | --ip6_addr_to_string (const struct in6_addr *addr, const char *iface) |
1073 | --{ |
1074 | -- char *buf; |
1075 | -- |
1076 | -- if (IN6_IS_ADDR_V4MAPPED (addr)) { |
1077 | -- /* inet_ntop is probably supposed to do this for us, but it doesn't */ |
1078 | -- buf = g_malloc (INET_ADDRSTRLEN); |
1079 | -- nm_utils_inet4_ntop (addr->s6_addr32[3], buf); |
1080 | -- } else if (!iface || !iface[0] || !IN6_IS_ADDR_LINKLOCAL (addr)) { |
1081 | -- buf = g_malloc (INET6_ADDRSTRLEN); |
1082 | -- nm_utils_inet6_ntop (addr, buf); |
1083 | -- } else { |
1084 | -- /* If we got a scope identifier, we need use '%' instead of |
1085 | -- * '@', since dnsmasq supports '%' in server= addresses |
1086 | -- * only since version 2.58 and up |
1087 | -- */ |
1088 | -- buf = g_strconcat (nm_utils_inet6_ntop (addr, NULL), "@", iface, NULL); |
1089 | -- } |
1090 | -- return buf; |
1091 | --} |
1092 | -- |
1093 | ++ add_dnsmasq_nameserver (self, servers, |
1094 | ++ nm_utils_inet4_ntop (addr, NULL), NULL); |
1095 | + } |
1096 | + } |
1097 | + |
1098 | +@@ -148,7 +178,7 @@ ip6_addr_to_string (const struct in6_add |
1099 | + } |
1100 | + |
1101 | + static void |
1102 | +-add_global_config (GString *str, const NMGlobalDnsConfig *config) |
1103 | ++add_global_config (NMDnsDnsmasq *self, GVariantBuilder *dnsmasq_servers, const NMGlobalDnsConfig *config) |
1104 | + { |
1105 | + guint i, j; |
1106 | + |
1107 | +@@ -163,16 +193,16 @@ add_global_config (GString *str, const N |
1108 | + |
1109 | + for (j = 0; servers && servers[j]; j++) { |
1110 | + if (!strcmp (name, "*")) |
1111 | +- g_string_append_printf (str, "server=%s\n", servers[j]); |
1112 | ++ add_dnsmasq_nameserver (self, dnsmasq_servers, servers[j], NULL); |
1113 | + else |
1114 | +- g_string_append_printf (str, "server=/%s/%s\n", name, servers[j]); |
1115 | ++ add_dnsmasq_nameserver (self, dnsmasq_servers, servers[j], name); |
1116 | + } |
1117 | + |
1118 | + } |
1119 | + } |
1120 | + |
1121 | static gboolean |
1122 | -add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split) |
1123 | -+add_ip6_config (DBusMessage *message, NMIP6Config *ip6, gboolean split) |
1124 | ++add_ip6_config (NMDnsDnsmasq *self, GVariantBuilder *servers, NMIP6Config *ip6, gboolean split) |
1125 | { |
1126 | const struct in6_addr *addr; |
1127 | -- char *buf = NULL; |
1128 | - int nnameservers, i_nameserver, n, i; |
1129 | - gboolean added = FALSE; |
1130 | - const char *iface; |
1131 | -@@ -158,14 +153,32 @@ add_ip6_config (GString *str, NMIP6Confi |
1132 | - |
1133 | - for (i_nameserver = 0; i_nameserver < nnameservers; i_nameserver++) { |
1134 | - addr = nm_ip6_config_get_nameserver (ip6, i_nameserver); |
1135 | -- buf = ip6_addr_to_string (addr, iface); |
1136 | -+ dbus_message_append_args (message, |
1137 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[0], |
1138 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[1], |
1139 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[2], |
1140 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[3], |
1141 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[4], |
1142 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[5], |
1143 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[6], |
1144 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[7], |
1145 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[8], |
1146 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[9], |
1147 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[10], |
1148 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[11], |
1149 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[12], |
1150 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[13], |
1151 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[14], |
1152 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[15], |
1153 | -+ DBUS_TYPE_INVALID); |
1154 | - |
1155 | + char *buf = NULL; |
1156 | +@@ -196,9 +226,10 @@ add_ip6_config (GString *str, NMIP6Confi |
1157 | /* searches are preferred over domains */ |
1158 | n = nm_ip6_config_get_num_searches (ip6); |
1159 | for (i = 0; i < n; i++) { |
1160 | - g_string_append_printf (str, "server=/%s/%s\n", |
1161 | - nm_ip6_config_get_search (ip6, i), |
1162 | - buf); |
1163 | -+ char *search = nm_ip6_config_get_search (ip6, i); |
1164 | -+ dbus_message_append_args (message, |
1165 | -+ DBUS_TYPE_STRING, &search, |
1166 | -+ DBUS_TYPE_INVALID); |
1167 | ++ add_dnsmasq_nameserver (self, |
1168 | ++ servers, |
1169 | ++ buf, |
1170 | ++ nm_ip6_config_get_search (ip6, i)); |
1171 | added = TRUE; |
1172 | } |
1173 | |
1174 | -@@ -173,14 +186,13 @@ add_ip6_config (GString *str, NMIP6Confi |
1175 | +@@ -206,9 +237,10 @@ add_ip6_config (GString *str, NMIP6Confi |
1176 | /* If not searches, use any domains */ |
1177 | n = nm_ip6_config_get_num_domains (ip6); |
1178 | for (i = 0; i < n; i++) { |
1179 | - g_string_append_printf (str, "server=/%s/%s\n", |
1180 | - nm_ip6_config_get_domain (ip6, i), |
1181 | - buf); |
1182 | -+ char *domain = nm_ip6_config_get_domain (ip6, i); |
1183 | -+ dbus_message_append_args (message, |
1184 | -+ DBUS_TYPE_STRING, &domain, |
1185 | -+ DBUS_TYPE_INVALID); |
1186 | ++ add_dnsmasq_nameserver (self, |
1187 | ++ servers, |
1188 | ++ buf, |
1189 | ++ nm_ip6_config_get_domain (ip6, i)); |
1190 | added = TRUE; |
1191 | } |
1192 | } |
1193 | -- |
1194 | -- g_free (buf); |
1195 | - } |
1196 | - } |
1197 | - |
1198 | -@@ -188,11 +200,24 @@ add_ip6_config (GString *str, NMIP6Confi |
1199 | - if (!added) { |
1200 | - for (i = 0; i < nnameservers; i++) { |
1201 | +@@ -223,7 +255,7 @@ add_ip6_config (GString *str, NMIP6Confi |
1202 | addr = nm_ip6_config_get_nameserver (ip6, i); |
1203 | -- buf = ip6_addr_to_string (addr, iface); |
1204 | -- if (buf) { |
1205 | + buf = ip6_addr_to_string (addr, iface); |
1206 | + if (buf) { |
1207 | - g_string_append_printf (str, "server=%s\n", buf); |
1208 | -- g_free (buf); |
1209 | -- } |
1210 | -+ dbus_message_append_args (message, |
1211 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[0], |
1212 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[1], |
1213 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[2], |
1214 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[3], |
1215 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[4], |
1216 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[5], |
1217 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[6], |
1218 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[7], |
1219 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[8], |
1220 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[9], |
1221 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[10], |
1222 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[11], |
1223 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[12], |
1224 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[13], |
1225 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[14], |
1226 | -+ DBUS_TYPE_BYTE, &addr->s6_addr[15], |
1227 | -+ DBUS_TYPE_INVALID); |
1228 | ++ add_dnsmasq_nameserver (self, servers, buf, NULL); |
1229 | + g_free (buf); |
1230 | + } |
1231 | } |
1232 | - } |
1233 | - |
1234 | -@@ -200,28 +225,26 @@ add_ip6_config (GString *str, NMIP6Confi |
1235 | +@@ -232,6 +264,176 @@ add_ip6_config (GString *str, NMIP6Confi |
1236 | + return TRUE; |
1237 | } |
1238 | |
1239 | - static gboolean |
1240 | --update (NMDnsPlugin *plugin, |
1241 | -- const GSList *vpn_configs, |
1242 | -- const GSList *dev_configs, |
1243 | -- const GSList *other_configs, |
1244 | -- const char *hostname) |
1245 | ++static void |
1246 | ++dnsmasq_update_done (GObject *source, GAsyncResult *res, gpointer user_data) |
1247 | ++{ |
1248 | ++ NMDnsDnsmasq *self = NM_DNS_DNSMASQ (user_data); |
1249 | ++ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1250 | ++ gs_free_error GError *error = NULL; |
1251 | ++ gs_unref_variant GVariant *response; |
1252 | ++ |
1253 | ++ response = g_dbus_proxy_call_finish (priv->dnsmasq, res, &error); |
1254 | ++ if (!response) |
1255 | ++ _LOGW ("dnsmasq update failed: %s", error->message); |
1256 | ++} |
1257 | ++ |
1258 | ++static gboolean |
1259 | ++send_dnsmasq_update (NMDnsDnsmasq *self) |
1260 | ++{ |
1261 | ++ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1262 | ++ |
1263 | ++ g_return_val_if_fail (priv->set_servers_ex_args, FALSE); |
1264 | ++ |
1265 | ++ if (priv->running) { |
1266 | ++ _LOGD ("trying to update dnsmasq nameservers"); |
1267 | ++ |
1268 | ++ g_dbus_proxy_call (priv->dnsmasq, |
1269 | ++ "SetServersEx", |
1270 | ++ priv->set_servers_ex_args, |
1271 | ++ G_DBUS_CALL_FLAGS_NONE, |
1272 | ++ -1, |
1273 | ++ NULL, |
1274 | ++ (GAsyncReadyCallback) dnsmasq_update_done, |
1275 | ++ self); |
1276 | ++ g_clear_pointer (&priv->set_servers_ex_args, g_variant_unref); |
1277 | ++ } else |
1278 | ++ _LOGW ("dnsmasq not found on the bus. The nameserver update will be sent when dnsmasq appears"); |
1279 | ++ |
1280 | ++ return TRUE; |
1281 | ++} |
1282 | ++ |
1283 | ++static void |
1284 | ++name_owner_changed (GObject *object, |
1285 | ++ GParamSpec *pspec, |
1286 | ++ gpointer user_data) |
1287 | ++{ |
1288 | ++ NMDnsDnsmasq *self = NM_DNS_DNSMASQ (user_data); |
1289 | ++ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1290 | ++ gs_free char *owner = NULL; |
1291 | ++ |
1292 | ++ owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (object)); |
1293 | ++ if (owner) { |
1294 | ++ _LOGI ("dnsmasq appeared as %s", owner); |
1295 | ++ priv->running = TRUE; |
1296 | ++ g_signal_emit_by_name (self, NM_DNS_PLUGIN_APPEARED); |
1297 | ++ } else { |
1298 | ++ _LOGI ("dnsmasq disappeared"); |
1299 | ++ priv->running = FALSE; |
1300 | ++ g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); |
1301 | ++ } |
1302 | ++} |
1303 | ++ |
1304 | ++static void |
1305 | ++dnsmasq_proxy_cb (GObject *source, GAsyncResult *res, gpointer user_data) |
1306 | ++{ |
1307 | ++ NMDnsDnsmasq *self; |
1308 | ++ NMDnsDnsmasqPrivate *priv; |
1309 | ++ gs_free_error GError *error = NULL; |
1310 | ++ gs_free char *owner = NULL; |
1311 | ++ GDBusProxy *proxy; |
1312 | ++ |
1313 | ++ proxy = g_dbus_proxy_new_finish (res, &error); |
1314 | ++ if ( !proxy |
1315 | ++ && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
1316 | ++ return; |
1317 | ++ |
1318 | ++ self = NM_DNS_DNSMASQ (user_data); |
1319 | ++ |
1320 | ++ if (!proxy) { |
1321 | ++ _LOGW ("failed to connect to dnsmasq via DBus: %s", error->message); |
1322 | ++ g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); |
1323 | ++ return; |
1324 | ++ } |
1325 | ++ |
1326 | ++ priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1327 | ++ |
1328 | ++ priv->dnsmasq = proxy; |
1329 | ++ nm_clear_g_cancellable (&priv->dnsmasq_cancellable); |
1330 | ++ |
1331 | ++ _LOGD ("dnsmasq proxy creation successful"); |
1332 | ++ |
1333 | ++ g_signal_connect (priv->dnsmasq, "notify::g-name-owner", |
1334 | ++ G_CALLBACK (name_owner_changed), self); |
1335 | ++ owner = g_dbus_proxy_get_name_owner (priv->dnsmasq); |
1336 | ++ priv->running = (owner != NULL); |
1337 | ++ |
1338 | ++ if (priv->running && priv->set_servers_ex_args) |
1339 | ++ send_dnsmasq_update (self); |
1340 | ++} |
1341 | ++ |
1342 | ++static gboolean |
1343 | +start_dnsmasq (NMDnsDnsmasq *self) |
1344 | ++{ |
1345 | ++ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1346 | ++ const char *dm_binary; |
1347 | ++ const char *argv[15]; |
1348 | ++ GPid pid = 0; |
1349 | ++ guint idx = 0; |
1350 | ++ |
1351 | ++ /* dnsmasq is probably already started; if it's the case, don't do |
1352 | ++ * anything more. |
1353 | ++ */ |
1354 | ++ if (priv->running) { |
1355 | ++ _LOGD ("dnsmasq is already running"); |
1356 | ++ return TRUE; |
1357 | ++ } |
1358 | ++ |
1359 | ++ /* Start dnsmasq */ |
1360 | ++ |
1361 | ++ dm_binary = nm_utils_find_helper ("dnsmasq", DNSMASQ_PATH, NULL); |
1362 | ++ if (!dm_binary) { |
1363 | ++ _LOGW ("could not find dnsmasq binary"); |
1364 | ++ return FALSE; |
1365 | ++ } |
1366 | ++ |
1367 | ++ argv[idx++] = dm_binary; |
1368 | ++ argv[idx++] = "--no-resolv"; /* Use only commandline */ |
1369 | ++ argv[idx++] = "--keep-in-foreground"; |
1370 | ++ argv[idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */ |
1371 | ++ argv[idx++] = "--bind-interfaces"; |
1372 | ++ argv[idx++] = "--pid-file=" PIDFILE; |
1373 | ++ argv[idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ |
1374 | ++ argv[idx++] = "--cache-size=400"; |
1375 | ++ argv[idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ |
1376 | ++ argv[idx++] = "--enable-dbus=" DNSMASQ_DBUS_SERVICE; |
1377 | ++ |
1378 | ++ /* dnsmasq exits if the conf dir is not present */ |
1379 | ++ if (g_file_test (CONFDIR, G_FILE_TEST_IS_DIR)) |
1380 | ++ argv[idx++] = "--conf-dir=" CONFDIR; |
1381 | ++ |
1382 | ++ argv[idx++] = NULL; |
1383 | ++ nm_assert (idx <= G_N_ELEMENTS (argv)); |
1384 | ++ |
1385 | ++ /* And finally spawn dnsmasq */ |
1386 | ++ pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); |
1387 | ++ if (!pid) |
1388 | ++ return FALSE; |
1389 | ++ |
1390 | ++ if (!priv->dnsmasq && !priv->dnsmasq_cancellable) { |
1391 | ++ NMBusManager *dbus_mgr; |
1392 | ++ GDBusConnection *connection; |
1393 | ++ |
1394 | ++ dbus_mgr = nm_bus_manager_get (); |
1395 | ++ g_return_val_if_fail (dbus_mgr, FALSE); |
1396 | ++ |
1397 | ++ connection = nm_bus_manager_get_connection (dbus_mgr); |
1398 | ++ g_return_val_if_fail (connection, FALSE); |
1399 | ++ |
1400 | ++ priv->dnsmasq_cancellable = g_cancellable_new (); |
1401 | ++ g_dbus_proxy_new (connection, |
1402 | ++ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, |
1403 | ++ NULL, |
1404 | ++ DNSMASQ_DBUS_SERVICE, |
1405 | ++ DNSMASQ_DBUS_PATH, |
1406 | ++ DNSMASQ_DBUS_SERVICE, |
1407 | ++ priv->dnsmasq_cancellable, |
1408 | ++ dnsmasq_proxy_cb, |
1409 | ++ self); |
1410 | ++ } |
1411 | ++ |
1412 | ++ return TRUE; |
1413 | ++} |
1414 | ++ |
1415 | + static gboolean |
1416 | + update (NMDnsPlugin *plugin, |
1417 | + const GSList *vpn_configs, |
1418 | +@@ -241,96 +443,59 @@ update (NMDnsPlugin *plugin, |
1419 | + const char *hostname) |
1420 | { |
1421 | -- NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); |
1422 | -+ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1423 | - const char *dm_binary; |
1424 | + NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); |
1425 | +- const char *dm_binary; |
1426 | - GString *conf; |
1427 | -- GSList *iter; |
1428 | - const char *argv[15]; |
1429 | - GError *error = NULL; |
1430 | - int ignored; |
1431 | - GPid pid = 0; |
1432 | - guint idx = 0; |
1433 | -+ char *dnsmasq_owner; |
1434 | -+ GString *conf; |
1435 | - |
1436 | ++ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1437 | + GSList *iter; |
1438 | +- const char *argv[15]; |
1439 | +- GError *error = NULL; |
1440 | +- int ignored; |
1441 | +- GPid pid = 0; |
1442 | +- guint idx = 0; |
1443 | +- |
1444 | - /* Kill the old dnsmasq; there doesn't appear to be a way to get dnsmasq |
1445 | - * to reread the config file using SIGHUP or similar. This is a small race |
1446 | - * here when restarting dnsmasq when DNS requests could go to the upstream |
1447 | - * servers instead of to dnsmasq. |
1448 | -+ /* dnsmasq is probably already started; if it's the case, don't do |
1449 | -+ * anything more. |
1450 | - */ |
1451 | +- */ |
1452 | - nm_dns_plugin_child_kill (plugin); |
1453 | -+ dnsmasq_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, DNSMASQ_DBUS_SERVICE, NULL); |
1454 | -+ if (dnsmasq_owner != NULL) |
1455 | -+ return TRUE; |
1456 | -+ |
1457 | -+ /* Start dnsmasq */ |
1458 | - |
1459 | - dm_binary = nm_utils_find_helper ("dnsmasq", DNSMASQ_PATH, NULL); |
1460 | - if (!dm_binary) { |
1461 | -@@ -232,30 +255,6 @@ update (NMDnsPlugin *plugin, |
1462 | - /* Build up the new dnsmasq config file */ |
1463 | - conf = g_string_sized_new (150); |
1464 | - |
1465 | -- /* Use split DNS for VPN configs */ |
1466 | -- for (iter = (GSList *) vpn_configs; iter; iter = g_slist_next (iter)) { |
1467 | -- if (NM_IS_IP4_CONFIG (iter->data)) |
1468 | -- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), TRUE); |
1469 | -- else if (NM_IS_IP6_CONFIG (iter->data)) |
1470 | -- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), TRUE); |
1471 | -- } |
1472 | -- |
1473 | -- /* Now add interface configs without split DNS */ |
1474 | -- for (iter = (GSList *) dev_configs; iter; iter = g_slist_next (iter)) { |
1475 | -- if (NM_IS_IP4_CONFIG (iter->data)) |
1476 | -- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); |
1477 | -- else if (NM_IS_IP6_CONFIG (iter->data)) |
1478 | -- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); |
1479 | -- } |
1480 | -- |
1481 | -- /* And any other random configs */ |
1482 | -- for (iter = (GSList *) other_configs; iter; iter = g_slist_next (iter)) { |
1483 | -- if (NM_IS_IP4_CONFIG (iter->data)) |
1484 | -- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); |
1485 | -- else if (NM_IS_IP6_CONFIG (iter->data)) |
1486 | -- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); |
1487 | -- } |
1488 | -- |
1489 | - /* Write out the config file */ |
1490 | - if (!g_file_set_contents (CONFFILE, conf->str, -1, &error)) { |
1491 | - nm_log_warn (LOGD_DNS, "Failed to write dnsmasq config file %s: (%d) %s", |
1492 | -@@ -280,6 +279,7 @@ update (NMDnsPlugin *plugin, |
1493 | - argv[idx++] = "--conf-file=" CONFFILE; |
1494 | - argv[idx++] = "--cache-size=400"; |
1495 | - argv[idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ |
1496 | -+ argv[idx++] = "--enable-dbus=" DNSMASQ_DBUS_SERVICE; |
1497 | - |
1498 | - /* dnsmasq exits if the conf dir is not present */ |
1499 | - if (g_file_test (CONFDIR, G_FILE_TEST_IS_DIR)) |
1500 | -@@ -296,8 +296,124 @@ out: |
1501 | - return pid ? TRUE : FALSE; |
1502 | - } |
1503 | - |
1504 | -+static gboolean |
1505 | -+update (NMDnsPlugin *plugin, |
1506 | -+ const GSList *vpn_configs, |
1507 | -+ const GSList *dev_configs, |
1508 | -+ const GSList *other_configs, |
1509 | -+ const char *hostname) |
1510 | -+{ |
1511 | -+ NMDnsDnsmasq *self = NM_DNS_DNSMASQ (plugin); |
1512 | -+ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1513 | -+ DBusConnection *connection; |
1514 | -+ DBusMessage *message; |
1515 | -+ GSList *iter; |
1516 | -+ GError *error = NULL; |
1517 | -+ gboolean have_dnsmasq = FALSE; |
1518 | + gboolean ret = FALSE; |
1519 | -+ dbus_bool_t result; |
1520 | -+ |
1521 | -+ have_dnsmasq = start_dnsmasq (self); |
1522 | -+ if (!have_dnsmasq) |
1523 | -+ goto out; |
1524 | -+ |
1525 | -+ connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr); |
1526 | -+ if (!connection) { |
1527 | -+ nm_log_warn (LOGD_DNS, "Could not get the system bus to speak to dnsmasq."); |
1528 | -+ goto out; |
1529 | -+ } |
1530 | -+ |
1531 | -+ message = dbus_message_new_method_call (DNSMASQ_DBUS_SERVICE, DNSMASQ_DBUS_PATH, |
1532 | -+ DNSMASQ_DBUS_INTERFACE, "SetServers"); |
1533 | -+ |
1534 | -+ /* Use split DNS for VPN configs */ |
1535 | -+ for (iter = (GSList *) vpn_configs; iter; iter = g_slist_next (iter)) { |
1536 | -+ if (NM_IS_IP4_CONFIG (iter->data)) |
1537 | -+ add_ip4_config (message, NM_IP4_CONFIG (iter->data), TRUE); |
1538 | -+ else if (NM_IS_IP6_CONFIG (iter->data)) |
1539 | -+ add_ip6_config (message, NM_IP6_CONFIG (iter->data), TRUE); |
1540 | -+ } |
1541 | -+ |
1542 | -+ /* Now add interface configs without split DNS */ |
1543 | -+ for (iter = (GSList *) dev_configs; iter; iter = g_slist_next (iter)) { |
1544 | -+ if (NM_IS_IP4_CONFIG (iter->data)) |
1545 | -+ add_ip4_config (message, NM_IP4_CONFIG (iter->data), FALSE); |
1546 | -+ else if (NM_IS_IP6_CONFIG (iter->data)) |
1547 | -+ add_ip6_config (message, NM_IP6_CONFIG (iter->data), FALSE); |
1548 | -+ } |
1549 | -+ |
1550 | -+ /* And any other random configs */ |
1551 | -+ for (iter = (GSList *) other_configs; iter; iter = g_slist_next (iter)) { |
1552 | -+ if (NM_IS_IP4_CONFIG (iter->data)) |
1553 | -+ add_ip4_config (message, NM_IP4_CONFIG (iter->data), FALSE); |
1554 | -+ else if (NM_IS_IP6_CONFIG (iter->data)) |
1555 | -+ add_ip6_config (message, NM_IP6_CONFIG (iter->data), FALSE); |
1556 | -+ } |
1557 | -+ |
1558 | -+ if (!nm_dbus_manager_get_name_owner (priv->dbus_mgr, DNSMASQ_DBUS_SERVICE, &error)) { |
1559 | -+ nm_log_warn (LOGD_DNS, "dnsmasq not available on the bus, can't update servers."); |
1560 | -+ if (error) |
1561 | -+ nm_log_err (LOGD_DNS, "dnsmasq owner not found on bus: %s", error->message); |
1562 | -+ goto out; |
1563 | -+ } |
1564 | -+ |
1565 | -+ dbus_message_set_no_reply (message, TRUE); |
1566 | -+ |
1567 | -+ result = dbus_connection_send (connection, message, NULL); |
1568 | -+ if (!result) { |
1569 | -+ nm_log_err (LOGD_DNS, "Could not send dnsmasq SetServers method."); |
1570 | -+ goto out; |
1571 | -+ } |
1572 | -+ |
1573 | -+ ret = TRUE; |
1574 | -+ |
1575 | ++ GVariantBuilder servers; |
1576 | + |
1577 | +- dm_binary = nm_utils_find_helper ("dnsmasq", DNSMASQ_PATH, NULL); |
1578 | +- if (!dm_binary) { |
1579 | +- _LOGW ("could not find dnsmasq binary"); |
1580 | +- return FALSE; |
1581 | +- } |
1582 | ++ if (!priv->running) |
1583 | ++ start_dnsmasq (self); |
1584 | + |
1585 | +- /* Build up the new dnsmasq config file */ |
1586 | +- conf = g_string_sized_new (150); |
1587 | ++ g_variant_builder_init (&servers, G_VARIANT_TYPE ("aas")); |
1588 | + |
1589 | ++ /* Build up the new dnsmasq config file */ |
1590 | + if (global_config) |
1591 | +- add_global_config (conf, global_config); |
1592 | ++ add_global_config (self, &servers, global_config); |
1593 | + else { |
1594 | + /* Use split DNS for VPN configs */ |
1595 | + for (iter = (GSList *) vpn_configs; iter; iter = g_slist_next (iter)) { |
1596 | + if (NM_IS_IP4_CONFIG (iter->data)) |
1597 | +- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), TRUE); |
1598 | ++ add_ip4_config (self, &servers, iter->data, TRUE); |
1599 | + else if (NM_IS_IP6_CONFIG (iter->data)) |
1600 | +- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), TRUE); |
1601 | ++ add_ip6_config (self, &servers, iter->data, TRUE); |
1602 | + } |
1603 | + |
1604 | + /* Now add interface configs without split DNS */ |
1605 | + for (iter = (GSList *) dev_configs; iter; iter = g_slist_next (iter)) { |
1606 | + if (NM_IS_IP4_CONFIG (iter->data)) |
1607 | +- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); |
1608 | ++ add_ip4_config (self, &servers, iter->data, FALSE); |
1609 | + else if (NM_IS_IP6_CONFIG (iter->data)) |
1610 | +- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); |
1611 | ++ add_ip6_config (self, &servers, iter->data, FALSE); |
1612 | + } |
1613 | + |
1614 | + /* And any other random configs */ |
1615 | + for (iter = (GSList *) other_configs; iter; iter = g_slist_next (iter)) { |
1616 | + if (NM_IS_IP4_CONFIG (iter->data)) |
1617 | +- add_ip4_config (conf, NM_IP4_CONFIG (iter->data), FALSE); |
1618 | ++ add_ip4_config (self, &servers, iter->data, FALSE); |
1619 | + else if (NM_IS_IP6_CONFIG (iter->data)) |
1620 | +- add_ip6_config (conf, NM_IP6_CONFIG (iter->data), FALSE); |
1621 | ++ add_ip6_config (self, &servers, iter->data, FALSE); |
1622 | + } |
1623 | + } |
1624 | ++ g_clear_pointer (&priv->set_servers_ex_args, g_variant_unref); |
1625 | ++ priv->set_servers_ex_args = g_variant_ref_sink (g_variant_new ("(aas)", &servers)); |
1626 | + |
1627 | +- /* Write out the config file */ |
1628 | +- if (!g_file_set_contents (CONFFILE, conf->str, -1, &error)) { |
1629 | +- _LOGW ("failed to write dnsmasq config file %s: %s", |
1630 | +- CONFFILE, |
1631 | +- error->message); |
1632 | +- g_clear_error (&error); |
1633 | +- goto out; |
1634 | +- } |
1635 | +- ignored = chmod (CONFFILE, 0644); |
1636 | +- |
1637 | +- _LOGD ("dnsmasq local caching DNS configuration:"); |
1638 | +- _LOGD ("%s", conf->str); |
1639 | +- |
1640 | +- argv[idx++] = dm_binary; |
1641 | +- argv[idx++] = "--no-resolv"; /* Use only commandline */ |
1642 | +- argv[idx++] = "--keep-in-foreground"; |
1643 | +- argv[idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */ |
1644 | +- argv[idx++] = "--bind-interfaces"; |
1645 | +- argv[idx++] = "--pid-file=" PIDFILE; |
1646 | +- argv[idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */ |
1647 | +- argv[idx++] = "--conf-file=" CONFFILE; |
1648 | +- argv[idx++] = "--cache-size=400"; |
1649 | +- argv[idx++] = "--proxy-dnssec"; /* Allow DNSSEC to pass through */ |
1650 | +- |
1651 | +- /* dnsmasq exits if the conf dir is not present */ |
1652 | +- if (g_file_test (CONFDIR, G_FILE_TEST_IS_DIR)) |
1653 | +- argv[idx++] = "--conf-dir=" CONFDIR; |
1654 | +- |
1655 | +- argv[idx++] = NULL; |
1656 | +- g_warn_if_fail (idx <= G_N_ELEMENTS (argv)); |
1657 | ++ ret = send_dnsmasq_update (self); |
1658 | + |
1659 | +- /* And finally spawn dnsmasq */ |
1660 | +- pid = nm_dns_plugin_child_spawn (NM_DNS_PLUGIN (self), argv, PIDFILE, "bin/dnsmasq"); |
1661 | + /* If all the configs lists are empty, there is just nothing to be caching -- |
1662 | + * we cleared up the dnsmasq cache; but we should also fail the update, so |
1663 | + * that we don't write 127.0.0.1 to resolv.conf. |
1664 | + */ |
1665 | -+ if (((vpn_configs && g_slist_length (vpn_configs) < 1) || !vpn_configs) && |
1666 | -+ ((dev_configs && g_slist_length (dev_configs) < 1) || !dev_configs) && |
1667 | -+ ((other_configs && g_slist_length (other_configs) < 1) || !other_configs)) |
1668 | ++ if (((vpn_configs && g_slist_length ((GSList *) vpn_configs) < 1) || !vpn_configs) && |
1669 | ++ ((dev_configs && g_slist_length ((GSList *) dev_configs) < 1) || !dev_configs) && |
1670 | ++ ((other_configs && g_slist_length ((GSList *) other_configs) < 1) || !other_configs)) |
1671 | + ret = FALSE; |
1672 | -+ |
1673 | -+out: |
1674 | -+ if (message) |
1675 | -+ dbus_message_unref (message); |
1676 | -+ |
1677 | + |
1678 | +-out: |
1679 | +- g_string_free (conf, TRUE); |
1680 | +- return pid ? TRUE : FALSE; |
1681 | + return ret; |
1682 | -+} |
1683 | -+ |
1684 | + } |
1685 | + |
1686 | /****************************************************************/ |
1687 | - |
1688 | -+static void |
1689 | -+name_owner_changed_cb (NMDBusManager *dbus_mgr, |
1690 | -+ const char *name, |
1691 | -+ const char *old_owner, |
1692 | -+ const char *new_owner, |
1693 | -+ gpointer user_data) |
1694 | -+{ |
1695 | -+ NMDnsDnsmasq *self = NM_DNS_DNSMASQ (user_data); |
1696 | -+ gboolean old_owner_good = (old_owner && strlen (old_owner)); |
1697 | -+ gboolean new_owner_good = (new_owner && strlen (new_owner)); |
1698 | -+ |
1699 | -+ /* Can't handle the signal if its not from dnsmasq */ |
1700 | -+ if (strcmp (DNSMASQ_DBUS_SERVICE, name)) |
1701 | -+ return; |
1702 | -+ |
1703 | -+ if (!old_owner_good && new_owner_good) { |
1704 | -+ nm_log_warn (LOGD_DNS, "dnsmasq appeared on DBus: %s", |
1705 | -+ new_owner); |
1706 | -+ g_signal_emit_by_name (self, NM_DNS_PLUGIN_APPEARED); |
1707 | -+ } else if (old_owner_good && new_owner_good) { |
1708 | -+ nm_log_dbg (LOGD_DNS, "DBus name owner for dnsmasq changed: %s -> %s", |
1709 | -+ old_owner, new_owner); |
1710 | -+ g_signal_emit_by_name (self, NM_DNS_PLUGIN_APPEARED); |
1711 | -+ } else { |
1712 | -+ nm_log_warn (LOGD_DNS, "dnsmasq disappeared from the bus."); |
1713 | -+ g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); |
1714 | -+ } |
1715 | -+} |
1716 | -+ |
1717 | - static const char * |
1718 | - dm_exit_code_to_msg (int status) |
1719 | - { |
1720 | -@@ -369,13 +485,31 @@ nm_dns_dnsmasq_new (void) |
1721 | - static void |
1722 | - nm_dns_dnsmasq_init (NMDnsDnsmasq *self) |
1723 | - { |
1724 | -+ NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (self); |
1725 | -+ |
1726 | -+ priv->dbus_mgr = nm_dbus_manager_get (); |
1727 | -+ |
1728 | -+ g_assert (priv->dbus_mgr); |
1729 | -+ |
1730 | -+ priv->name_owner_id = g_signal_connect (priv->dbus_mgr, |
1731 | -+ NM_DBUS_MANAGER_NAME_OWNER_CHANGED, |
1732 | -+ G_CALLBACK (name_owner_changed_cb), |
1733 | -+ self); |
1734 | - } |
1735 | - |
1736 | +@@ -374,7 +539,6 @@ child_quit (NMDnsPlugin *plugin, gint st |
1737 | + _LOGW ("dnsmasq died with signal %d", WTERMSIG (status)); |
1738 | + else |
1739 | + _LOGW ("dnsmasq died from an unknown cause"); |
1740 | +- unlink (CONFFILE); |
1741 | + |
1742 | + if (failed) |
1743 | + g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED); |
1744 | +@@ -410,7 +574,13 @@ nm_dns_dnsmasq_init (NMDnsDnsmasq *self) |
1745 | static void |
1746 | dispose (GObject *object) |
1747 | { |
1748 | +- unlink (CONFFILE); |
1749 | + NMDnsDnsmasqPrivate *priv = NM_DNS_DNSMASQ_GET_PRIVATE (object); |
1750 | + |
1751 | - unlink (CONFFILE); |
1752 | ++ nm_clear_g_cancellable (&priv->dnsmasq_cancellable); |
1753 | ++ |
1754 | ++ g_clear_object (&priv->dnsmasq); |
1755 | ++ |
1756 | ++ g_clear_pointer (&priv->set_servers_ex_args, g_variant_builder_unref); |
1757 | |
1758 | -+ if (priv->dbus_mgr) { |
1759 | -+ if (priv->name_owner_id) |
1760 | -+ g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); |
1761 | -+ g_object_unref (priv->dbus_mgr); |
1762 | -+ } |
1763 | -+ |
1764 | G_OBJECT_CLASS (nm_dns_dnsmasq_parent_class)->dispose (object); |
1765 | } |
1766 | - |
1767 | Index: b/src/dns-manager/nm-dns-manager.c |
1768 | =================================================================== |
1769 | --- a/src/dns-manager/nm-dns-manager.c |
1770 | +++ b/src/dns-manager/nm-dns-manager.c |
1771 | -@@ -800,6 +800,27 @@ update_dns (NMDnsManager *self, |
1772 | +@@ -1065,6 +1065,24 @@ update_dns (NMDnsManager *self, |
1773 | } |
1774 | |
1775 | static void |
1776 | +plugin_appeared (NMDnsPlugin *plugin, gpointer user_data) |
1777 | +{ |
1778 | + NMDnsManager *self = NM_DNS_MANAGER (user_data); |
1779 | -+ NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); |
1780 | + GError *error = NULL; |
1781 | + |
1782 | + /* Not applicable to non-caching plugins */ |
1783 | @@ -499,9 +533,7 @@ |
1784 | + /* Try to update DNS again; since it's now available on the bus this |
1785 | + * might work. */ |
1786 | + if (!update_dns (self, FALSE, &error)) { |
1787 | -+ nm_log_warn (LOGD_DNS, "could not commit DNS changes: (%d) %s", |
1788 | -+ error ? error->code : -1, |
1789 | -+ error && error->message ? error->message : "(unknown)"); |
1790 | ++ _LOGW ("could not commit DNS changes: %s", error->message); |
1791 | + g_clear_error (&error); |
1792 | + } |
1793 | +} |
1794 | @@ -510,19 +542,19 @@ |
1795 | plugin_failed (NMDnsPlugin *plugin, gpointer user_data) |
1796 | { |
1797 | NMDnsManager *self = NM_DNS_MANAGER (user_data); |
1798 | -@@ -1129,6 +1150,7 @@ init_resolv_conf_mode (NMDnsManager *sel |
1799 | - nm_log_info (LOGD_DNS, "DNS: loaded plugin %s", nm_dns_plugin_get_name (priv->plugin)); |
1800 | +@@ -1432,6 +1450,7 @@ init_resolv_conf_mode (NMDnsManager *sel |
1801 | + |
1802 | g_signal_connect (priv->plugin, NM_DNS_PLUGIN_FAILED, G_CALLBACK (plugin_failed), self); |
1803 | g_signal_connect (priv->plugin, NM_DNS_PLUGIN_CHILD_QUIT, G_CALLBACK (plugin_child_quit), self); |
1804 | + g_signal_connect (priv->plugin, NM_DNS_PLUGIN_APPEARED, G_CALLBACK (plugin_appeared), self); |
1805 | - } |
1806 | - } |
1807 | |
1808 | + _NMLOG (immutable ? LOGL_WARN : LOGL_INFO, |
1809 | + "%s%s%s%s%s%s", |
1810 | Index: b/src/dns-manager/nm-dns-plugin.c |
1811 | =================================================================== |
1812 | --- a/src/dns-manager/nm-dns-plugin.c |
1813 | +++ b/src/dns-manager/nm-dns-plugin.c |
1814 | -@@ -45,6 +45,7 @@ G_DEFINE_TYPE_EXTENDED (NMDnsPlugin, nm_ |
1815 | +@@ -43,6 +43,7 @@ G_DEFINE_TYPE_EXTENDED (NMDnsPlugin, nm_ |
1816 | |
1817 | enum { |
1818 | FAILED, |
1819 | @@ -530,9 +562,9 @@ |
1820 | CHILD_QUIT, |
1821 | LAST_SIGNAL |
1822 | }; |
1823 | -@@ -132,6 +133,12 @@ watch_cb (GPid pid, gint status, gpointe |
1824 | - g_free (priv->progname); |
1825 | - priv->progname = NULL; |
1826 | +@@ -159,6 +160,12 @@ watch_cb (GPid pid, gint status, gpointe |
1827 | + |
1828 | + _clear_pidfile (self); |
1829 | |
1830 | + if (priv->pidfile) { |
1831 | + unlink (priv->pidfile); |
1832 | @@ -543,10 +575,11 @@ |
1833 | g_signal_emit (self, signals[CHILD_QUIT], 0, status); |
1834 | } |
1835 | |
1836 | -@@ -261,6 +268,15 @@ nm_dns_plugin_class_init (NMDnsPluginCla |
1837 | - G_OBJECT_CLASS_TYPE (object_class), |
1838 | - G_SIGNAL_RUN_FIRST, |
1839 | - G_STRUCT_OFFSET (NMDnsPluginClass, failed), |
1840 | +@@ -273,7 +280,16 @@ nm_dns_plugin_class_init (NMDnsPluginCla |
1841 | + G_OBJECT_CLASS_TYPE (object_class), |
1842 | + G_SIGNAL_RUN_FIRST, |
1843 | + G_STRUCT_OFFSET (NMDnsPluginClass, failed), |
1844 | +- NULL, NULL, |
1845 | + NULL, NULL, |
1846 | + g_cclosure_marshal_VOID__VOID, |
1847 | + G_TYPE_NONE, 0); |
1848 | @@ -556,14 +589,15 @@ |
1849 | + G_OBJECT_CLASS_TYPE (object_class), |
1850 | + G_SIGNAL_RUN_FIRST, |
1851 | + G_STRUCT_OFFSET (NMDnsPluginClass, failed), |
1852 | - NULL, NULL, |
1853 | - g_cclosure_marshal_VOID__VOID, |
1854 | - G_TYPE_NONE, 0); |
1855 | ++ NULL, NULL, |
1856 | + g_cclosure_marshal_VOID__VOID, |
1857 | + G_TYPE_NONE, 0); |
1858 | + |
1859 | Index: b/src/dns-manager/nm-dns-plugin.h |
1860 | =================================================================== |
1861 | --- a/src/dns-manager/nm-dns-plugin.h |
1862 | +++ b/src/dns-manager/nm-dns-plugin.h |
1863 | -@@ -30,6 +30,7 @@ |
1864 | +@@ -31,6 +31,7 @@ |
1865 | #define NM_DNS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_PLUGIN, NMDnsPluginClass)) |
1866 | |
1867 | #define NM_DNS_PLUGIN_FAILED "failed" |
1868 | @@ -575,10 +609,10 @@ |
1869 | =================================================================== |
1870 | --- a/src/org.freedesktop.NetworkManager.conf |
1871 | +++ b/src/org.freedesktop.NetworkManager.conf |
1872 | -@@ -25,6 +25,13 @@ |
1873 | - <allow send_destination="org.freedesktop.NetworkManager.vpnc"/> |
1874 | - <allow send_destination="org.freedesktop.NetworkManager.ssh"/> |
1875 | - <allow send_destination="org.freedesktop.NetworkManager.iodine"/> |
1876 | +@@ -26,6 +26,13 @@ |
1877 | + <allow send_destination="org.freedesktop.NetworkManager.fortisslvpn"/> |
1878 | + <allow send_destination="org.freedesktop.NetworkManager.strongswan"/> |
1879 | + <allow send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/> |
1880 | + |
1881 | + <!-- Allow the custom name for the dnsmasq instance spawned by NM |
1882 | + from the dns dnsmasq plugin to own it's dbus name, and for |
1883 | @@ -589,10 +623,10 @@ |
1884 | </policy> |
1885 | <policy user="whoopsie"> |
1886 | <allow send_destination="org.freedesktop.NetworkManager"/> |
1887 | -@@ -137,6 +144,9 @@ |
1888 | - <deny send_interface="org.freedesktop.NetworkManager.Settings" send_member="ReloadConnections"/> |
1889 | - <deny send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/> |
1890 | - <deny send_interface="org.freedesktop.NetworkManager.PPP"/> |
1891 | +@@ -145,6 +152,9 @@ |
1892 | + <deny send_destination="org.freedesktop.NetworkManager" |
1893 | + send_interface="org.freedesktop.NetworkManager.Settings" |
1894 | + send_member="ReloadConnections"/> |
1895 | + |
1896 | + <deny own="org.freedesktop.NetworkManager.dnsmasq"/> |
1897 | + <deny send_destination="org.freedesktop.NetworkManager.dnsmasq"/> |
1898 | |
1899 | === removed file 'debian/patches/0001-libnm-libnm-util-add-Wi-Fi-powersave-property.patch' |
1900 | --- debian/patches/0001-libnm-libnm-util-add-Wi-Fi-powersave-property.patch 2015-08-20 01:07:00 +0000 |
1901 | +++ debian/patches/0001-libnm-libnm-util-add-Wi-Fi-powersave-property.patch 1970-01-01 00:00:00 +0000 |
1902 | @@ -1,253 +0,0 @@ |
1903 | -From ba09d590a6fe4601291ca4ae426ed7af98535b17 Mon Sep 17 00:00:00 2001 |
1904 | -From: Dan Williams <dcbw@redhat.com> |
1905 | -Date: Thu, 30 Oct 2014 09:49:38 -0500 |
1906 | -Subject: [PATCH 1/5] libnm/libnm-util: add Wi-Fi 'powersave' property |
1907 | - |
1908 | ---- |
1909 | - libnm-core/nm-setting-wireless.c | 34 ++++++++++++++++++++++++++++++ |
1910 | - libnm-core/nm-setting-wireless.h | 2 + |
1911 | - libnm-util/libnm-util.ver | 1 |
1912 | - libnm-util/nm-setting-wireless.c | 44 +++++++++++++++++++++++++++++++++++++++ |
1913 | - libnm-util/nm-setting-wireless.h | 2 + |
1914 | - libnm/libnm.ver | 1 |
1915 | - 6 files changed, 84 insertions(+) |
1916 | - |
1917 | -Index: b/libnm-util/libnm-util.ver |
1918 | -=================================================================== |
1919 | ---- a/libnm-util/libnm-util.ver |
1920 | -+++ b/libnm-util/libnm-util.ver |
1921 | -@@ -562,6 +562,7 @@ global: |
1922 | - nm_setting_wireless_get_mtu; |
1923 | - nm_setting_wireless_get_num_mac_blacklist_items; |
1924 | - nm_setting_wireless_get_num_seen_bssids; |
1925 | -+ nm_setting_wireless_get_powersave; |
1926 | - nm_setting_wireless_get_rate; |
1927 | - nm_setting_wireless_get_security; |
1928 | - nm_setting_wireless_get_seen_bssid; |
1929 | -Index: b/libnm-util/nm-setting-wireless.c |
1930 | -=================================================================== |
1931 | ---- a/libnm-util/nm-setting-wireless.c |
1932 | -+++ b/libnm-util/nm-setting-wireless.c |
1933 | -@@ -87,6 +87,7 @@ typedef struct { |
1934 | - GSList *seen_bssids; |
1935 | - char *security; |
1936 | - gboolean hidden; |
1937 | -+ guint32 powersave; |
1938 | - } NMSettingWirelessPrivate; |
1939 | - |
1940 | - enum { |
1941 | -@@ -105,6 +106,7 @@ enum { |
1942 | - PROP_SEEN_BSSIDS, |
1943 | - PROP_SEC, |
1944 | - PROP_HIDDEN, |
1945 | -+ PROP_POWERSAVE, |
1946 | - |
1947 | - LAST_PROP |
1948 | - }; |
1949 | -@@ -662,6 +664,20 @@ nm_setting_wireless_get_hidden (NMSettin |
1950 | - } |
1951 | - |
1952 | - /** |
1953 | -+ * nm_setting_wireless_get_powersave: |
1954 | -+ * @setting: the #NMSettingWireless |
1955 | -+ * |
1956 | -+ * Returns: the #NMSettingWireless:powersave property of the setting |
1957 | -+ **/ |
1958 | -+guint32 |
1959 | -+nm_setting_wireless_get_powersave (NMSettingWireless *setting) |
1960 | -+{ |
1961 | -+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); |
1962 | -+ |
1963 | -+ return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave; |
1964 | -+} |
1965 | -+ |
1966 | -+/** |
1967 | - * nm_setting_wireless_add_seen_bssid: |
1968 | - * @setting: the #NMSettingWireless |
1969 | - * @bssid: the new BSSID to add to the list |
1970 | -@@ -860,6 +876,16 @@ verify (NMSetting *setting, GSList *all_ |
1971 | - } |
1972 | - } |
1973 | - |
1974 | -+ if (priv->powersave > 1) { |
1975 | -+ g_set_error (error, |
1976 | -+ NM_SETTING_WIRELESS_ERROR, |
1977 | -+ NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, |
1978 | -+ _("'%u' is not a valid powersave value"), |
1979 | -+ priv->powersave); |
1980 | -+ g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_POWERSAVE); |
1981 | -+ return FALSE; |
1982 | -+ } |
1983 | -+ |
1984 | - return TRUE; |
1985 | - } |
1986 | - |
1987 | -@@ -953,6 +979,9 @@ set_property (GObject *object, guint pro |
1988 | - case PROP_HIDDEN: |
1989 | - priv->hidden = g_value_get_boolean (value); |
1990 | - break; |
1991 | -+ case PROP_POWERSAVE: |
1992 | -+ priv->powersave = g_value_get_uint (value); |
1993 | -+ break; |
1994 | - default: |
1995 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
1996 | - break; |
1997 | -@@ -1008,6 +1037,9 @@ get_property (GObject *object, guint pro |
1998 | - case PROP_HIDDEN: |
1999 | - g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting)); |
2000 | - break; |
2001 | -+ case PROP_POWERSAVE: |
2002 | -+ g_value_set_uint (value, nm_setting_wireless_get_powersave (setting)); |
2003 | -+ break; |
2004 | - default: |
2005 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
2006 | - break; |
2007 | -@@ -1244,4 +1276,16 @@ nm_setting_wireless_class_init (NMSettin |
2008 | - FALSE, |
2009 | - G_PARAM_READWRITE | |
2010 | - G_PARAM_STATIC_STRINGS)); |
2011 | -+ |
2012 | -+ /** |
2013 | -+ * NMSettingWireless:powersave: |
2014 | -+ * |
2015 | -+ * If set to 0, Wi-Fi power saving behavior is disabled. If set to 1, |
2016 | -+ * Wi-Fi power saving behavior is enabled. All other values are reserved. |
2017 | -+ **/ |
2018 | -+ g_object_class_install_property |
2019 | -+ (object_class, PROP_POWERSAVE, |
2020 | -+ g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "", |
2021 | -+ 0, G_MAXUINT32, 0, |
2022 | -+ G_PARAM_READWRITE)); |
2023 | - } |
2024 | -Index: b/libnm-util/nm-setting-wireless.h |
2025 | -=================================================================== |
2026 | ---- a/libnm-util/nm-setting-wireless.h |
2027 | -+++ b/libnm-util/nm-setting-wireless.h |
2028 | -@@ -73,6 +73,7 @@ GQuark nm_setting_wireless_error_quark ( |
2029 | - #define NM_SETTING_WIRELESS_MTU "mtu" |
2030 | - #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" |
2031 | - #define NM_SETTING_WIRELESS_HIDDEN "hidden" |
2032 | -+#define NM_SETTING_WIRELESS_POWERSAVE "powersave" |
2033 | - |
2034 | - /* Deprecated */ |
2035 | - #define NM_SETTING_WIRELESS_SEC "security" |
2036 | -@@ -150,6 +151,7 @@ void nm_setting_wireless_cl |
2037 | - |
2038 | - guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); |
2039 | - gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting); |
2040 | -+guint32 nm_setting_wireless_get_powersave (NMSettingWireless *setting); |
2041 | - |
2042 | - gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, |
2043 | - const char *bssid); |
2044 | -Index: b/libnm-core/nm-setting-wireless.c |
2045 | -=================================================================== |
2046 | ---- a/libnm-core/nm-setting-wireless.c |
2047 | -+++ b/libnm-core/nm-setting-wireless.c |
2048 | -@@ -60,6 +60,7 @@ typedef struct { |
2049 | - guint32 mtu; |
2050 | - GSList *seen_bssids; |
2051 | - gboolean hidden; |
2052 | -+ guint32 powersave; |
2053 | - } NMSettingWirelessPrivate; |
2054 | - |
2055 | - enum { |
2056 | -@@ -77,6 +78,7 @@ enum { |
2057 | - PROP_MTU, |
2058 | - PROP_SEEN_BSSIDS, |
2059 | - PROP_HIDDEN, |
2060 | -+ PROP_POWERSAVE, |
2061 | - |
2062 | - LAST_PROP |
2063 | - }; |
2064 | -@@ -602,6 +604,20 @@ nm_setting_wireless_get_hidden (NMSettin |
2065 | - } |
2066 | - |
2067 | - /** |
2068 | -+ * nm_setting_wireless_get_powersave: |
2069 | -+ * @setting: the #NMSettingWireless |
2070 | -+ * |
2071 | -+ * Returns: the #NMSettingWireless:powersave property of the setting |
2072 | -+ **/ |
2073 | -+guint32 |
2074 | -+nm_setting_wireless_get_powersave (NMSettingWireless *setting) |
2075 | -+{ |
2076 | -+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); |
2077 | -+ |
2078 | -+ return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave; |
2079 | -+} |
2080 | -+ |
2081 | -+/** |
2082 | - * nm_setting_wireless_add_seen_bssid: |
2083 | - * @setting: the #NMSettingWireless |
2084 | - * @bssid: the new BSSID to add to the list |
2085 | -@@ -916,6 +932,9 @@ set_property (GObject *object, guint pro |
2086 | - case PROP_HIDDEN: |
2087 | - priv->hidden = g_value_get_boolean (value); |
2088 | - break; |
2089 | -+ case PROP_POWERSAVE: |
2090 | -+ priv->powersave = g_value_get_uint (value); |
2091 | -+ break; |
2092 | - default: |
2093 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
2094 | - break; |
2095 | -@@ -969,6 +988,9 @@ get_property (GObject *object, guint pro |
2096 | - case PROP_HIDDEN: |
2097 | - g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting)); |
2098 | - break; |
2099 | -+ case PROP_POWERSAVE: |
2100 | -+ g_value_set_uint (value, nm_setting_wireless_get_powersave (setting)); |
2101 | -+ break; |
2102 | - default: |
2103 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
2104 | - break; |
2105 | -@@ -1315,6 +1337,18 @@ nm_setting_wireless_class_init (NMSettin |
2106 | - G_PARAM_READWRITE | |
2107 | - G_PARAM_STATIC_STRINGS)); |
2108 | - |
2109 | -+ /** |
2110 | -+ * NMSettingWireless:powersave: |
2111 | -+ * |
2112 | -+ * If set to 0, Wi-Fi power saving behavior is disabled. If set to 1, |
2113 | -+ * Wi-Fi power saving behavior is enabled. All other values are reserved. |
2114 | -+ **/ |
2115 | -+ g_object_class_install_property |
2116 | -+ (object_class, PROP_POWERSAVE, |
2117 | -+ g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "", |
2118 | -+ 0, G_MAXUINT32, 0, |
2119 | -+ G_PARAM_READWRITE)); |
2120 | -+ |
2121 | - /* Compatibility for deprecated property */ |
2122 | - /* ---ifcfg-rh--- |
2123 | - * property: security |
2124 | -Index: b/libnm-core/nm-setting-wireless.h |
2125 | -=================================================================== |
2126 | ---- a/libnm-core/nm-setting-wireless.h |
2127 | -+++ b/libnm-core/nm-setting-wireless.h |
2128 | -@@ -55,6 +55,7 @@ G_BEGIN_DECLS |
2129 | - #define NM_SETTING_WIRELESS_MTU "mtu" |
2130 | - #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" |
2131 | - #define NM_SETTING_WIRELESS_HIDDEN "hidden" |
2132 | -+#define NM_SETTING_WIRELESS_POWERSAVE "powersave" |
2133 | - |
2134 | - /** |
2135 | - * NM_SETTING_WIRELESS_MODE_ADHOC: |
2136 | -@@ -118,6 +119,7 @@ void nm_setting_wireless_cl |
2137 | - |
2138 | - guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); |
2139 | - gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting); |
2140 | -+guint32 nm_setting_wireless_get_powersave (NMSettingWireless *setting); |
2141 | - |
2142 | - gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, |
2143 | - const char *bssid); |
2144 | -Index: b/libnm/libnm.ver |
2145 | -=================================================================== |
2146 | ---- a/libnm/libnm.ver |
2147 | -+++ b/libnm/libnm.ver |
2148 | -@@ -705,6 +705,7 @@ global: |
2149 | - nm_setting_wireless_get_mtu; |
2150 | - nm_setting_wireless_get_num_mac_blacklist_items; |
2151 | - nm_setting_wireless_get_num_seen_bssids; |
2152 | -+ nm_setting_wireless_get_powersave; |
2153 | - nm_setting_wireless_get_rate; |
2154 | - nm_setting_wireless_get_seen_bssid; |
2155 | - nm_setting_wireless_get_ssid; |
2156 | |
2157 | === removed file 'debian/patches/0001-wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch' |
2158 | --- debian/patches/0001-wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch 2015-08-20 01:07:00 +0000 |
2159 | +++ debian/patches/0001-wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch 1970-01-01 00:00:00 +0000 |
2160 | @@ -1,108 +0,0 @@ |
2161 | -From dfb178d6597099fc0c85e70e727601a1c5542c79 Mon Sep 17 00:00:00 2001 |
2162 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
2163 | -Date: Tue, 11 Nov 2014 12:00:48 -0500 |
2164 | -Subject: [PATCH 1/2] wifi: Signal on the wifi device when its supplicant is |
2165 | - done scanning. |
2166 | - |
2167 | -This makes it possible for applications outside NetworkManager to listen for |
2168 | -that signal, and use it along with RequestScan to get very up-to-date scan |
2169 | -results. |
2170 | - |
2171 | -Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
2172 | ---- |
2173 | - introspection/nm-device-wifi.xml | 6 ++++++ |
2174 | - src/devices/wifi/nm-device-wifi.c | 11 +++++++++++ |
2175 | - src/devices/wifi/nm-device-wifi.h | 1 + |
2176 | - src/supplicant-manager/nm-supplicant-interface.c | 6 ++++-- |
2177 | - 4 files changed, 22 insertions(+), 2 deletions(-) |
2178 | - |
2179 | -Index: b/introspection/nm-device-wifi.xml |
2180 | -=================================================================== |
2181 | ---- a/introspection/nm-device-wifi.xml |
2182 | -+++ b/introspection/nm-device-wifi.xml |
2183 | -@@ -120,6 +120,12 @@ |
2184 | - </tp:docstring> |
2185 | - </signal> |
2186 | - |
2187 | -+ <signal name="ScanDone"> |
2188 | -+ <tp:docstring> |
2189 | -+ Emitted when the device has finished scanning for new APs. |
2190 | -+ </tp:docstring> |
2191 | -+ </signal> |
2192 | -+ |
2193 | - <tp:flags name="NM_802_11_DEVICE_CAP" type="u"> |
2194 | - <tp:docstring> |
2195 | - Flags describing the capabilities of a wireless device. |
2196 | -Index: b/src/devices/wifi/nm-device-wifi.c |
2197 | -=================================================================== |
2198 | ---- a/src/devices/wifi/nm-device-wifi.c |
2199 | -+++ b/src/devices/wifi/nm-device-wifi.c |
2200 | -@@ -103,6 +103,7 @@ enum { |
2201 | - ACCESS_POINT_ADDED, |
2202 | - ACCESS_POINT_REMOVED, |
2203 | - SCANNING_ALLOWED, |
2204 | -+ SCAN_DONE, |
2205 | - |
2206 | - LAST_SIGNAL |
2207 | - }; |
2208 | -@@ -1606,6 +1607,8 @@ supplicant_iface_scan_done_cb (NMSupplic |
2209 | - |
2210 | - _LOGD (LOGD_WIFI_SCAN, "scan %s", success ? "successful" : "failed"); |
2211 | - |
2212 | -+ g_signal_emit (self, signals[SCAN_DONE], 0, NULL); |
2213 | -+ |
2214 | - schedule_scan (self, success); |
2215 | - |
2216 | - /* Ensure that old APs get removed, which otherwise only |
2217 | -@@ -3361,6 +3364,14 @@ nm_device_wifi_class_init (NMDeviceWifiC |
2218 | - scanning_allowed_accumulator, NULL, NULL, |
2219 | - G_TYPE_BOOLEAN, 0); |
2220 | - |
2221 | -+ signals[SCAN_DONE] = |
2222 | -+ g_signal_new ("scan-done", |
2223 | -+ G_OBJECT_CLASS_TYPE (object_class), |
2224 | -+ G_SIGNAL_RUN_FIRST, |
2225 | -+ G_STRUCT_OFFSET (NMDeviceWifiClass, scan_done), |
2226 | -+ NULL, NULL, NULL, |
2227 | -+ G_TYPE_NONE, 0); |
2228 | -+ |
2229 | - nm_dbus_manager_register_exported_type (nm_dbus_manager_get (), |
2230 | - G_TYPE_FROM_CLASS (klass), |
2231 | - &dbus_glib_nm_device_wifi_object_info); |
2232 | -Index: b/src/devices/wifi/nm-device-wifi.h |
2233 | -=================================================================== |
2234 | ---- a/src/devices/wifi/nm-device-wifi.h |
2235 | -+++ b/src/devices/wifi/nm-device-wifi.h |
2236 | -@@ -70,6 +70,7 @@ struct _NMDeviceWifiClass |
2237 | - void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap); |
2238 | - void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap); |
2239 | - gboolean (*scanning_allowed) (NMDeviceWifi *device); |
2240 | -+ void (*scan_done) (NMDeviceWifi *device); |
2241 | - }; |
2242 | - |
2243 | - |
2244 | -Index: b/src/supplicant-manager/nm-supplicant-interface.c |
2245 | -=================================================================== |
2246 | ---- a/src/supplicant-manager/nm-supplicant-interface.c |
2247 | -+++ b/src/supplicant-manager/nm-supplicant-interface.c |
2248 | -@@ -1086,6 +1086,7 @@ nm_supplicant_interface_set_config (NMSu |
2249 | - static void |
2250 | - scan_request_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data) |
2251 | - { |
2252 | -+ NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); |
2253 | - gs_unref_variant GVariant *reply = NULL; |
2254 | - gs_free_error GError *error = NULL; |
2255 | - |
2256 | -@@ -1093,9 +1094,10 @@ scan_request_cb (GDBusProxy *proxy, GAsy |
2257 | - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) |
2258 | - return; |
2259 | - |
2260 | -- if (error) |
2261 | -+ if (error) { |
2262 | - nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", error->message); |
2263 | -- g_signal_emit (NM_SUPPLICANT_INTERFACE (user_data), signals[SCAN_DONE], 0, error ? FALSE : TRUE); |
2264 | -+ g_signal_emit (self, signals[SCAN_DONE], 0, FALSE); |
2265 | -+ } |
2266 | - } |
2267 | - |
2268 | - gboolean |
2269 | |
2270 | === removed file 'debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch' |
2271 | --- debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 2015-09-26 02:33:57 +0000 |
2272 | +++ debian/patches/0001-wwan-add-support-for-using-oFono-as-a-modem-manager.patch 1970-01-01 00:00:00 +0000 |
2273 | @@ -1,1653 +0,0 @@ |
2274 | -From 7469d3c11789a6c42f020c64214b813a925b5417 Mon Sep 17 00:00:00 2001 |
2275 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
2276 | -Date: Tue, 11 Nov 2014 22:20:30 -0500 |
2277 | -Subject: [PATCH] wwan: add support for using oFono as a modem manager |
2278 | - |
2279 | -Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
2280 | ---- |
2281 | - configure.ac | 9 |
2282 | - src/NetworkManagerUtils.c | 20 |
2283 | - src/devices/wwan/Makefile.am | 7 |
2284 | - src/devices/wwan/nm-device-modem.c | 18 |
2285 | - src/devices/wwan/nm-modem-manager.c | 219 ++++++ |
2286 | - src/devices/wwan/nm-modem-ofono.c | 1172 ++++++++++++++++++++++++++++++++++++ |
2287 | - src/devices/wwan/nm-modem-ofono.h | 64 + |
2288 | - 7 files changed, 1500 insertions(+), 9 deletions(-) |
2289 | - create mode 100644 src/devices/wwan/nm-modem-ofono.c |
2290 | - create mode 100644 src/devices/wwan/nm-modem-ofono.h |
2291 | - |
2292 | -Index: b/configure.ac |
2293 | -=================================================================== |
2294 | ---- a/configure.ac |
2295 | -+++ b/configure.ac |
2296 | -@@ -686,6 +686,15 @@ else |
2297 | - fi |
2298 | - AM_CONDITIONAL(WITH_BLUEZ5_DUN, test "${enable_bluez5_dun}" = "yes") |
2299 | - |
2300 | -+# OFONO |
2301 | -+AC_ARG_WITH(ofono, AS_HELP_STRING([--with-ofono], [Enable oFono support]),,[with_ofono=yes]) |
2302 | -+if (test "${with_ofono}" = "yes"); then |
2303 | -+ AC_DEFINE(WITH_OFONO, 1, [Define if you have oFono support]) |
2304 | -+else |
2305 | -+ AC_DEFINE(WITH_OFONO, 0, [Define if you have oFono support]) |
2306 | -+fi |
2307 | -+AM_CONDITIONAL(WITH_OFONO, test "${with_ofono}" = "yes") |
2308 | -+ |
2309 | - # DHCP client support |
2310 | - AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support])) |
2311 | - AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support])) |
2312 | -Index: b/src/devices/wwan/Makefile.am |
2313 | -=================================================================== |
2314 | ---- a/src/devices/wwan/Makefile.am |
2315 | -+++ b/src/devices/wwan/Makefile.am |
2316 | -@@ -40,6 +40,13 @@ libnm_wwan_la_SOURCES = \ |
2317 | - \ |
2318 | - $(GLIB_GENERATED) |
2319 | - |
2320 | -+if WITH_OFONO |
2321 | -+libnm_wwan_la_SOURCES += \ |
2322 | -+ nm-modem-ofono.c \ |
2323 | -+ nm-modem-ofono.h \ |
2324 | -+ $(NULL) |
2325 | -+endif |
2326 | -+ |
2327 | - WWAN_SYMBOL_VIS_FILE=$(srcdir)/wwan-exports.ver |
2328 | - |
2329 | - libnm_wwan_la_LDFLAGS = \ |
2330 | -Index: b/src/devices/wwan/nm-modem-manager.c |
2331 | -=================================================================== |
2332 | ---- a/src/devices/wwan/nm-modem-manager.c |
2333 | -+++ b/src/devices/wwan/nm-modem-manager.c |
2334 | -@@ -17,7 +17,7 @@ |
2335 | - * |
2336 | - * Copyright (C) 2009 - 2014 Red Hat, Inc. |
2337 | - * Copyright (C) 2009 Novell, Inc. |
2338 | -- * Copyright (C) 2009 Canonical Ltd. |
2339 | -+ * Copyright (C) 2009 - 2013 Canonical Ltd. |
2340 | - */ |
2341 | - |
2342 | - #include "config.h" |
2343 | -@@ -31,6 +31,11 @@ |
2344 | - #include "nm-modem.h" |
2345 | - #include "nm-modem-broadband.h" |
2346 | - |
2347 | -+#if WITH_OFONO |
2348 | -+#include "nm-dbus-manager.h" |
2349 | -+#include "nm-modem-ofono.h" |
2350 | -+#endif |
2351 | -+ |
2352 | - #define MODEM_POKE_INTERVAL 120 |
2353 | - |
2354 | - G_DEFINE_TYPE (NMModemManager, nm_modem_manager, G_TYPE_OBJECT) |
2355 | -@@ -43,6 +48,12 @@ struct _NMModemManagerPrivate { |
2356 | - guint mm_object_added_id; |
2357 | - guint mm_object_removed_id; |
2358 | - |
2359 | -+#if WITH_OFONO |
2360 | -+ GDBusProxy *ofono_proxy; |
2361 | -+ |
2362 | -+ guint ofono_name_owner_changed_id; |
2363 | -+#endif |
2364 | -+ |
2365 | - /* Common */ |
2366 | - GHashTable *modems; |
2367 | - }; |
2368 | -@@ -226,6 +237,179 @@ modem_manager_name_owner_changed (MMMana |
2369 | - */ |
2370 | - } |
2371 | - |
2372 | -+#if WITH_OFONO |
2373 | -+static void |
2374 | -+ofono_clear_signals (NMModemManager *self) |
2375 | -+{ |
2376 | -+ if (!self->priv->ofono_proxy) |
2377 | -+ return; |
2378 | -+ |
2379 | -+ if (self->priv->ofono_name_owner_changed_id) { |
2380 | -+ if (g_signal_handler_is_connected (self->priv->ofono_proxy, |
2381 | -+ self->priv->ofono_name_owner_changed_id)) |
2382 | -+ g_signal_handler_disconnect (self->priv->ofono_proxy, |
2383 | -+ self->priv->ofono_name_owner_changed_id); |
2384 | -+ self->priv->ofono_name_owner_changed_id = 0; |
2385 | -+ } |
2386 | -+} |
2387 | -+ |
2388 | -+static void |
2389 | -+ofono_create_modem (NMModemManager *self, const char *path) |
2390 | -+{ |
2391 | -+ NMModem *modem = NULL; |
2392 | -+ |
2393 | -+ if (g_hash_table_lookup (self->priv->modems, path)) { |
2394 | -+ nm_log_warn (LOGD_MB, "modem with path %s already exists, ignoring", path); |
2395 | -+ return; |
2396 | -+ } |
2397 | -+ |
2398 | -+ /* Create modem instance */ |
2399 | -+ modem = nm_modem_ofono_new (path); |
2400 | -+ if (modem) |
2401 | -+ handle_new_modem (self, modem); |
2402 | -+ else |
2403 | -+ nm_log_warn (LOGD_MB, "Failed to create oFono modem for %s", path); |
2404 | -+} |
2405 | -+ |
2406 | -+static void |
2407 | -+ofono_signal_cb (GDBusProxy *proxy, |
2408 | -+ gchar *sender_name, |
2409 | -+ gchar *signal_name, |
2410 | -+ GVariant *parameters, |
2411 | -+ gpointer user_data) |
2412 | -+{ |
2413 | -+ NMModemManager *self = NM_MODEM_MANAGER (user_data); |
2414 | -+ gchar *object_path; |
2415 | -+ NMModem *modem; |
2416 | -+ |
2417 | -+ if (g_strcmp0 (signal_name, "ModemAdded") == 0) { |
2418 | -+ g_variant_get (parameters, "(oa{sv})", &object_path, NULL); |
2419 | -+ nm_log_info (LOGD_MB, "oFono modem appeared: %s", object_path); |
2420 | -+ |
2421 | -+ ofono_create_modem (NM_MODEM_MANAGER (user_data), object_path); |
2422 | -+ g_free (object_path); |
2423 | -+ } else if (g_strcmp0 (signal_name, "ModemRemoved") == 0) { |
2424 | -+ g_variant_get (parameters, "(o)", &object_path); |
2425 | -+ nm_log_info (LOGD_MB, "oFono modem removed: %s", object_path); |
2426 | -+ |
2427 | -+ modem = (NMModem *) g_hash_table_lookup (self->priv->modems, object_path); |
2428 | -+ if (modem) { |
2429 | -+ nm_modem_emit_removed (modem); |
2430 | -+ g_hash_table_remove (self->priv->modems, object_path); |
2431 | -+ } else { |
2432 | -+ nm_log_warn (LOGD_MB, "could not remove modem %s, not found in table", |
2433 | -+ object_path); |
2434 | -+ } |
2435 | -+ g_free (object_path); |
2436 | -+ } |
2437 | -+} |
2438 | -+ |
2439 | -+#define OFONO_DBUS_MODEM_ENTRY (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID)) |
2440 | -+#define OFONO_DBUS_MODEM_ENTRIES (dbus_g_type_get_collection ("GPtrArray", OFONO_DBUS_MODEM_ENTRY)) |
2441 | -+ |
2442 | -+static void |
2443 | -+ofono_enumerate_devices_done (GDBusProxy *proxy, GAsyncResult *res, gpointer user_data) |
2444 | -+{ |
2445 | -+ NMModemManager *manager = NM_MODEM_MANAGER (user_data); |
2446 | -+ GPtrArray *modems; |
2447 | -+ GError *error = NULL; |
2448 | -+ GVariant *results; |
2449 | -+ GVariantIter *iter; |
2450 | -+ const char *path; |
2451 | -+ |
2452 | -+ results = g_dbus_proxy_call_finish (proxy, res, &error); |
2453 | -+ if (results) { |
2454 | -+ g_variant_get (results, "(a(oa{sv}))", &iter); |
2455 | -+ while (g_variant_iter_loop (iter, "(&oa{sv})", &path, NULL)) { |
2456 | -+ ofono_create_modem (manager, path); |
2457 | -+ } |
2458 | -+ g_variant_iter_free (iter); |
2459 | -+ g_variant_unref (results); |
2460 | -+ } |
2461 | -+ |
2462 | -+ if (error) |
2463 | -+ nm_log_warn (LOGD_MB, "failed to enumerate oFono devices: %s", |
2464 | -+ error->message ? error->message : "(unknown)"); |
2465 | -+} |
2466 | -+ |
2467 | -+static void ofono_appeared (NMModemManager *self); |
2468 | -+ |
2469 | -+static void |
2470 | -+ofono_check_name_owner (NMModemManager *self) |
2471 | -+{ |
2472 | -+ gchar *name_owner; |
2473 | -+ |
2474 | -+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (self->priv->ofono_proxy)); |
2475 | -+ if (name_owner) { |
2476 | -+ /* Available! */ |
2477 | -+ ofono_appeared (self); |
2478 | -+ goto free; |
2479 | -+ } |
2480 | -+ |
2481 | -+ nm_log_info (LOGD_MB, "oFono disappeared from bus"); |
2482 | -+ |
2483 | -+ ofono_clear_signals (self); |
2484 | -+ g_clear_object (&self->priv->ofono_proxy); |
2485 | -+ ensure_client (self); |
2486 | -+ |
2487 | -+free: |
2488 | -+ g_free (name_owner); |
2489 | -+ return; |
2490 | -+} |
2491 | -+ |
2492 | -+static void |
2493 | -+ofono_name_owner_changed (GDBusProxy *ofono_proxy, |
2494 | -+ GParamSpec *pspec, |
2495 | -+ NMModemManager *self) |
2496 | -+{ |
2497 | -+ ofono_check_name_owner (self); |
2498 | -+} |
2499 | -+ |
2500 | -+static void |
2501 | -+ofono_appeared (NMModemManager *self) |
2502 | -+{ |
2503 | -+ nm_log_info (LOGD_MB, "ofono is now available"); |
2504 | -+ |
2505 | -+ self->priv->ofono_name_owner_changed_id = |
2506 | -+ g_signal_connect (self->priv->ofono_proxy, |
2507 | -+ "notify::name-owner", |
2508 | -+ G_CALLBACK (ofono_name_owner_changed), |
2509 | -+ self); |
2510 | -+ g_dbus_proxy_call (self->priv->ofono_proxy, |
2511 | -+ "GetModems", |
2512 | -+ NULL, |
2513 | -+ G_DBUS_CALL_FLAGS_NONE, |
2514 | -+ -1, |
2515 | -+ NULL, |
2516 | -+ (GAsyncReadyCallback) ofono_enumerate_devices_done, |
2517 | -+ g_object_ref (self)); |
2518 | -+ |
2519 | -+ g_signal_connect (self->priv->ofono_proxy, |
2520 | -+ "g-signal", |
2521 | -+ G_CALLBACK (ofono_signal_cb), |
2522 | -+ self); |
2523 | -+} |
2524 | -+ |
2525 | -+static void |
2526 | -+ofono_proxy_new_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) |
2527 | -+{ |
2528 | -+ NMModemManager *self = NM_MODEM_MANAGER (user_data); |
2529 | -+ GError *error = NULL; |
2530 | -+ |
2531 | -+ self->priv->ofono_proxy = g_dbus_proxy_new_finish (res, &error); |
2532 | -+ |
2533 | -+ if (error) { |
2534 | -+ //FIXME: do stuff if there's an error. |
2535 | -+ return; |
2536 | -+ } |
2537 | -+ |
2538 | -+ ofono_appeared (self); |
2539 | -+ |
2540 | -+ /* Balance refcount */ |
2541 | -+ g_object_unref (self); |
2542 | -+} |
2543 | -+#endif |
2544 | -+ |
2545 | - #if !HAVE_SYSTEMD |
2546 | - |
2547 | - static void |
2548 | -@@ -344,22 +528,43 @@ manager_new_ready (GObject *source, |
2549 | - static void |
2550 | - ensure_client (NMModemManager *self) |
2551 | - { |
2552 | -- g_assert (self->priv->dbus_connection); |
2553 | -+ NMModemManagerPrivate *priv = self->priv; |
2554 | -+ g_assert (priv->dbus_connection); |
2555 | -+ gboolean created = FALSE; |
2556 | - |
2557 | - /* Create the GDBusObjectManagerClient. We do not request to autostart, as |
2558 | - * we don't really want the MMManager creation to fail. We can always poke |
2559 | - * later on if we want to request the autostart */ |
2560 | -- if (!self->priv->modem_manager) { |
2561 | -- mm_manager_new (self->priv->dbus_connection, |
2562 | -+ if (!priv->modem_manager) { |
2563 | -+ mm_manager_new (priv->dbus_connection, |
2564 | - G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START, |
2565 | - NULL, |
2566 | - (GAsyncReadyCallback)manager_new_ready, |
2567 | - g_object_ref (self)); |
2568 | -- return; |
2569 | -+ created = TRUE; |
2570 | - } |
2571 | - |
2572 | -+#if WITH_OFONO |
2573 | -+ if (!priv->ofono_proxy) { |
2574 | -+ g_dbus_proxy_new (priv->dbus_connection, |
2575 | -+ G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START, |
2576 | -+ NULL, |
2577 | -+ OFONO_DBUS_SERVICE, |
2578 | -+ OFONO_DBUS_PATH, |
2579 | -+ OFONO_DBUS_INTERFACE, |
2580 | -+ NULL, |
2581 | -+ (GAsyncReadyCallback)ofono_proxy_new_cb, |
2582 | -+ g_object_ref (self)); |
2583 | -+ created = TRUE; |
2584 | -+ } |
2585 | -+#endif /* WITH_OFONO */ |
2586 | -+ |
2587 | -+ if (created) |
2588 | -+ return; |
2589 | -+ |
2590 | - /* If already available, recheck name owner! */ |
2591 | - modem_manager_check_name_owner (self); |
2592 | -+ ofono_check_name_owner (self); |
2593 | - } |
2594 | - |
2595 | - static void |
2596 | -@@ -441,6 +646,10 @@ dispose (GObject *object) |
2597 | - |
2598 | - modem_manager_clear_signals (self); |
2599 | - g_clear_object (&self->priv->modem_manager); |
2600 | -+#if WITH_OFONO |
2601 | -+ ofono_clear_signals (self); |
2602 | -+ g_clear_object (&self->priv->ofono_proxy); |
2603 | -+#endif |
2604 | - g_clear_object (&self->priv->dbus_connection); |
2605 | - |
2606 | - if (self->priv->modems) { |
2607 | -Index: b/src/devices/wwan/nm-modem-ofono.c |
2608 | -=================================================================== |
2609 | ---- /dev/null |
2610 | -+++ b/src/devices/wwan/nm-modem-ofono.c |
2611 | -@@ -0,0 +1,1172 @@ |
2612 | -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
2613 | -+/* NetworkManager -- Network link manager |
2614 | -+ * |
2615 | -+ * This program is free software; you can redistribute it and/or modify |
2616 | -+ * it under the terms of the GNU General Public License as published by |
2617 | -+ * the Free Software Foundation; either version 2 of the License, or |
2618 | -+ * (at your option) any later version. |
2619 | -+ * |
2620 | -+ * This program is distributed in the hope that it will be useful, |
2621 | -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2622 | -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2623 | -+ * GNU General Public License for more details. |
2624 | -+ * |
2625 | -+ * You should have received a copy of the GNU General Public License along |
2626 | -+ * with this program; if not, write to the Free Software Foundation, Inc., |
2627 | -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
2628 | -+ * |
2629 | -+ * Copyright (C) 2013 Canonical Ltd. |
2630 | -+ */ |
2631 | -+ |
2632 | -+#include "config.h" |
2633 | -+ |
2634 | -+#include <string.h> |
2635 | -+#include <glib/gi18n.h> |
2636 | -+ |
2637 | -+#include "nm-dbus-glib-types.h" |
2638 | -+#include "nm-modem-ofono.h" |
2639 | -+#include "nm-device.h" |
2640 | -+#include "nm-device-private.h" |
2641 | -+#include "nm-setting-connection.h" |
2642 | -+#include "nm-setting-gsm.h" |
2643 | -+#include "nm-settings-connection.h" |
2644 | -+#include "nm-enum-types.h" |
2645 | -+#include "nm-logging.h" |
2646 | -+#include "nm-modem.h" |
2647 | -+#include "nm-dbus-manager.h" |
2648 | -+#include "nm-platform.h" |
2649 | -+#include "nm-utils.h" |
2650 | -+ |
2651 | -+G_DEFINE_TYPE (NMModemOfono, nm_modem_ofono, NM_TYPE_MODEM) |
2652 | -+ |
2653 | -+#define NM_MODEM_OFONO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_OFONO, NMModemOfonoPrivate)) |
2654 | -+ |
2655 | -+typedef struct { |
2656 | -+ GHashTable *connect_properties; |
2657 | -+ |
2658 | -+ NMDBusManager *dbus_mgr; |
2659 | -+ |
2660 | -+ DBusGProxy *modem_proxy; |
2661 | -+ DBusGProxy *connman_proxy; |
2662 | -+ DBusGProxy *context_proxy; |
2663 | -+ DBusGProxy *simmanager_proxy; |
2664 | -+ |
2665 | -+ GError *property_error; |
2666 | -+ |
2667 | -+ char **interfaces; |
2668 | -+ char *context_path; |
2669 | -+ char *imsi; |
2670 | -+ |
2671 | -+ gboolean modem_online; |
2672 | -+ gboolean gprs_attached; |
2673 | -+ |
2674 | -+ NMIP4Config *ip4_config; |
2675 | -+ |
2676 | -+} NMModemOfonoPrivate; |
2677 | -+ |
2678 | -+#define NM_OFONO_ERROR (nm_ofono_error_quark ()) |
2679 | -+ |
2680 | -+static GQuark |
2681 | -+nm_ofono_error_quark (void) |
2682 | -+{ |
2683 | -+ static GQuark quark = 0; |
2684 | -+ if (!quark) |
2685 | -+ quark = g_quark_from_static_string ("nm-ofono-error"); |
2686 | -+ return quark; |
2687 | -+} |
2688 | -+ |
2689 | -+static gboolean |
2690 | -+ip_string_to_network_address (const gchar *str, |
2691 | -+ guint32 *out) |
2692 | -+{ |
2693 | -+ guint32 addr = 0; |
2694 | -+ gboolean success = FALSE; |
2695 | -+ |
2696 | -+ if (!str || inet_pton (AF_INET, str, &addr) != 1) |
2697 | -+ addr = 0; |
2698 | -+ else |
2699 | -+ success = TRUE; |
2700 | -+ |
2701 | -+ *out = (guint32)addr; |
2702 | -+ return success; |
2703 | -+} |
2704 | -+ |
2705 | -+static void |
2706 | -+update_modem_state (NMModemOfono *self) |
2707 | -+{ |
2708 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2709 | -+ NMModemState state = nm_modem_get_state (NM_MODEM (self)); |
2710 | -+ NMModemState new_state = NM_MODEM_STATE_UNKNOWN; |
2711 | -+ const char *reason = NULL; |
2712 | -+ |
2713 | -+ nm_log_info (LOGD_MB, "(%s): %s: 'Attached': %s 'Online': %s 'IMSI': %s", |
2714 | -+ nm_modem_get_path (NM_MODEM (self)), |
2715 | -+ __func__, |
2716 | -+ priv->gprs_attached ? "true" : "false", |
2717 | -+ priv->modem_online ? "true" : "false", |
2718 | -+ priv->imsi); |
2719 | -+ |
2720 | -+ if (priv->modem_online == FALSE) { |
2721 | -+ new_state = NM_MODEM_STATE_DISABLED; |
2722 | -+ reason = "modem 'Online=false'"; |
2723 | -+ } else if (priv->imsi == NULL && state != NM_MODEM_STATE_ENABLING) { |
2724 | -+ new_state = NM_MODEM_STATE_DISABLED; |
2725 | -+ reason = "modem not ready"; |
2726 | -+ } else if (priv->gprs_attached == FALSE) { |
2727 | -+ if (state >= NM_MODEM_STATE_ENABLING) { |
2728 | -+ new_state = NM_MODEM_STATE_SEARCHING; |
2729 | -+ reason = "modem searching"; |
2730 | -+ } |
2731 | -+ } else { |
2732 | -+ new_state = NM_MODEM_STATE_REGISTERED; |
2733 | -+ reason = "modem ready"; |
2734 | -+ } |
2735 | -+ |
2736 | -+ if (state != new_state) |
2737 | -+ nm_modem_set_state (NM_MODEM (self), new_state, reason); |
2738 | -+} |
2739 | -+ |
2740 | -+/* Disconnect stuff */ |
2741 | -+typedef struct { |
2742 | -+ NMModemOfono *self; |
2743 | -+ gboolean warn; |
2744 | -+} SimpleDisconnectContext; |
2745 | -+ |
2746 | -+static gboolean |
2747 | -+disconnect_finish (NMModem *self, |
2748 | -+ GAsyncResult *res, |
2749 | -+ GError **error) |
2750 | -+{ |
2751 | -+ /* FIXME: might actually be wrong, copied straight from NMModemBroadband. |
2752 | -+ * this is already working using GDBusProxy, so won't be called until the |
2753 | -+ * rest of this file is ported: uncomment when everything else is ported. |
2754 | -+ */ |
2755 | -+ //return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); |
2756 | -+ return FALSE; |
2757 | -+} |
2758 | -+ |
2759 | -+static void |
2760 | -+simple_disconnect_context_free (SimpleDisconnectContext *ctx) |
2761 | -+{ |
2762 | -+ g_object_unref (ctx->self); |
2763 | -+ g_slice_free (SimpleDisconnectContext, ctx); |
2764 | -+} |
2765 | -+ |
2766 | -+static void |
2767 | -+disconnect_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) |
2768 | -+{ |
2769 | -+ SimpleDisconnectContext *ctx = (SimpleDisconnectContext*) user_data; |
2770 | -+ NMModemOfono *self = ctx->self; |
2771 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2772 | -+ GError *error = NULL; |
2773 | -+ |
2774 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
2775 | -+ |
2776 | -+ if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) { |
2777 | -+ if (ctx->warn) |
2778 | -+ nm_log_warn (LOGD_MB, "(%s) failed to disconnect modem: %s", |
2779 | -+ nm_modem_get_uid (NM_MODEM (self)), |
2780 | -+ error && error->message ? error->message : "(unknown)"); |
2781 | -+ g_clear_error (&error); |
2782 | -+ } |
2783 | -+ |
2784 | -+ update_modem_state (self); |
2785 | -+ |
2786 | -+ simple_disconnect_context_free (ctx); |
2787 | -+} |
2788 | -+ |
2789 | -+static void |
2790 | -+disconnect (NMModem *self, |
2791 | -+ gboolean warn, |
2792 | -+ GCancellable *cancellable, |
2793 | -+ GAsyncReadyCallback callback, |
2794 | -+ gpointer user_data) |
2795 | -+{ |
2796 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2797 | -+ SimpleDisconnectContext *ctx; |
2798 | -+ GValue value = G_VALUE_INIT; |
2799 | -+ NMModemState state = nm_modem_get_state (NM_MODEM (self)); |
2800 | -+ |
2801 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
2802 | -+ |
2803 | -+ if (state != NM_MODEM_STATE_CONNECTED) |
2804 | -+ return; |
2805 | -+ |
2806 | -+ ctx = g_slice_new (SimpleDisconnectContext); |
2807 | -+ ctx->self = g_object_ref (self); |
2808 | -+ ctx->warn = warn; |
2809 | -+ |
2810 | -+ nm_modem_set_state (NM_MODEM (self), |
2811 | -+ NM_MODEM_STATE_DISCONNECTING, |
2812 | -+ nm_modem_state_to_string (NM_MODEM_STATE_DISCONNECTING)); |
2813 | -+ |
2814 | -+ g_value_init (&value, G_TYPE_BOOLEAN); |
2815 | -+ g_value_set_boolean (&value, FALSE); |
2816 | -+ |
2817 | -+ dbus_g_proxy_begin_call_with_timeout (priv->context_proxy, |
2818 | -+ "SetProperty", disconnect_done, |
2819 | -+ ctx, NULL, 20000, |
2820 | -+ G_TYPE_STRING, "Active", |
2821 | -+ G_TYPE_VALUE, &value, |
2822 | -+ G_TYPE_INVALID); |
2823 | -+} |
2824 | -+ |
2825 | -+static void |
2826 | -+deactivate_cleanup (NMModem *_self, NMDevice *device) |
2827 | -+{ |
2828 | -+ NMModemOfono *self = NM_MODEM_OFONO (_self); |
2829 | -+ |
2830 | -+ /* TODO: cancel SimpleConnect() if any */ |
2831 | -+ |
2832 | -+ /* TODO: Cleanup IPv4 addresses and routes */ |
2833 | -+ /* |
2834 | -+ g_clear_object (&self->priv->ipv4_config); |
2835 | -+ g_clear_object (&self->priv->ipv6_config); |
2836 | -+ */ |
2837 | -+ |
2838 | -+ /* |
2839 | -+ self->priv->pin_tries = 0; |
2840 | -+ */ |
2841 | -+ |
2842 | -+ /* Chain up parent's */ |
2843 | -+ NM_MODEM_CLASS (nm_modem_ofono_parent_class)->deactivate_cleanup (_self, device); |
2844 | -+} |
2845 | -+ |
2846 | -+DBusGProxy * |
2847 | -+get_ofono_proxy (NMModemOfono *self, const char *path, const char *interface) |
2848 | -+{ |
2849 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2850 | -+ DBusGConnection *bus; |
2851 | -+ DBusGProxy *proxy; |
2852 | -+ |
2853 | -+ bus = nm_dbus_manager_get_connection (priv->dbus_mgr); |
2854 | -+ |
2855 | -+ proxy = dbus_g_proxy_new_for_name (bus, |
2856 | -+ OFONO_DBUS_SERVICE, |
2857 | -+ path, |
2858 | -+ interface); |
2859 | -+ |
2860 | -+ return proxy; |
2861 | -+} |
2862 | -+static void |
2863 | -+handle_attached (NMModemOfono *self, GValue *value) |
2864 | -+{ |
2865 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2866 | -+ gboolean attached = g_value_get_boolean (value); |
2867 | -+ |
2868 | -+ if (priv->gprs_attached != attached) { |
2869 | -+ priv->gprs_attached = attached; |
2870 | -+ |
2871 | -+ nm_log_info (LOGD_MB, "(%s): %s: new value for 'Attached': %s", |
2872 | -+ nm_modem_get_path (NM_MODEM (self)), |
2873 | -+ __func__, |
2874 | -+ attached ? "true" : "false"); |
2875 | -+ |
2876 | -+ update_modem_state (self); |
2877 | -+ } |
2878 | -+} |
2879 | -+ |
2880 | -+ |
2881 | -+static void |
2882 | -+get_ofono_conn_manager_properties_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) |
2883 | -+{ |
2884 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
2885 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2886 | -+ GError *error = NULL; |
2887 | -+ GHashTable *properties = NULL; |
2888 | -+ GValue *value = NULL; |
2889 | -+ |
2890 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
2891 | -+ |
2892 | -+ if (!dbus_g_proxy_end_call (proxy, call_id, &error, |
2893 | -+ DBUS_TYPE_G_MAP_OF_VARIANT, &properties, |
2894 | -+ G_TYPE_INVALID)) { |
2895 | -+ nm_log_warn (LOGD_MB, "failed get connection manager properties: (%d) %s", |
2896 | -+ error ? error->code : -1, |
2897 | -+ error && error->message ? error->message : "(unknown)"); |
2898 | -+ goto done; |
2899 | -+ } |
2900 | -+ |
2901 | -+ value = g_hash_table_lookup (properties, "Attached"); |
2902 | -+ if (value) { |
2903 | -+ handle_attached (self, value); |
2904 | -+ g_value_unset (value); |
2905 | -+ } else |
2906 | -+ nm_log_warn (LOGD_MB, "(%s): %s: no 'Attached' property found", |
2907 | -+ nm_modem_get_path (NM_MODEM (self)), |
2908 | -+ __func__); |
2909 | -+ |
2910 | -+done: |
2911 | -+ g_object_unref (self); |
2912 | -+} |
2913 | -+ |
2914 | -+static void |
2915 | -+ofono_conn_properties_changed (DBusGProxy *proxy, |
2916 | -+ const char *key, |
2917 | -+ GValue *value, |
2918 | -+ gpointer user_data) |
2919 | -+{ |
2920 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
2921 | -+ |
2922 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
2923 | -+ |
2924 | -+ if (g_strcmp0 (key, "Attached") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) |
2925 | -+ handle_attached (self, value); |
2926 | -+} |
2927 | -+ |
2928 | -+static void |
2929 | -+handle_subscriber_identity (NMModemOfono *self, GValue *value) |
2930 | -+{ |
2931 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2932 | -+ const gchar *value_str = g_value_get_string (value); |
2933 | -+ |
2934 | -+ /* Check for empty DBus string value */ |
2935 | -+ if (g_strcmp0 (value_str, "(null)") != 0) { |
2936 | -+ |
2937 | -+ if (g_strcmp0 (value_str, priv->imsi) != 0) { |
2938 | -+ |
2939 | -+ if (priv->imsi != NULL) { |
2940 | -+ nm_log_warn (LOGD_MB, "SimManager:'SubscriberIdentity' changed: %s", priv->imsi); |
2941 | -+ g_free(priv->imsi); |
2942 | -+ } |
2943 | -+ |
2944 | -+ nm_log_info (LOGD_MB, "GetPropsDone: 'SubscriberIdentity': %s", priv->imsi); |
2945 | -+ |
2946 | -+ priv->imsi = g_strdup (value_str); |
2947 | -+ update_modem_state (self); |
2948 | -+ } |
2949 | -+ } |
2950 | -+} |
2951 | -+ |
2952 | -+ |
2953 | -+static void |
2954 | -+get_ofono_sim_properties_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) |
2955 | -+{ |
2956 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
2957 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
2958 | -+ NMModemState state = nm_modem_get_state (NM_MODEM (self)); |
2959 | -+ GError *error = NULL; |
2960 | -+ GHashTable *properties = NULL; |
2961 | -+ GValue *value = NULL; |
2962 | -+ const gchar *value_str; |
2963 | -+ |
2964 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
2965 | -+ |
2966 | -+ if (!dbus_g_proxy_end_call (proxy, call_id, &error, |
2967 | -+ DBUS_TYPE_G_MAP_OF_VARIANT, &properties, |
2968 | -+ G_TYPE_INVALID)) { |
2969 | -+ nm_log_warn (LOGD_MB, "failed to get ofono SimManager properties: (%d) %s", |
2970 | -+ error ? error->code : -1, |
2971 | -+ error && error->message ? error->message : "(unknown)"); |
2972 | -+ goto done; |
2973 | -+ } |
2974 | -+ |
2975 | -+ value = g_hash_table_lookup (properties, "SubscriberIdentity"); |
2976 | -+ |
2977 | -+ if (value) { |
2978 | -+ handle_subscriber_identity (self, value); |
2979 | -+ g_value_unset (value); |
2980 | -+ } else { |
2981 | -+ nm_log_warn (LOGD_MB, "failed to get SimManager:'SubscriberIdentity'; not found"); |
2982 | -+ } |
2983 | -+ |
2984 | -+done: |
2985 | -+ g_object_unref (self); |
2986 | -+ |
2987 | -+} |
2988 | -+ |
2989 | -+static void |
2990 | -+ofono_sim_properties_changed (DBusGProxy *proxy, |
2991 | -+ const char *key, |
2992 | -+ GValue *value, |
2993 | -+ gpointer user_data) |
2994 | -+{ |
2995 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
2996 | -+ |
2997 | -+ if (g_strcmp0 (key, "SubscriberIdentity") == 0 && G_VALUE_HOLDS_STRING (value)) |
2998 | -+ handle_subscriber_identity (self, value); |
2999 | -+} |
3000 | -+ |
3001 | -+static void |
3002 | -+ofono_context_added (DBusGProxy *proxy, |
3003 | -+ const char *path, |
3004 | -+ GValue *prop, |
3005 | -+ gpointer user_data) |
3006 | -+{ |
3007 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3008 | -+ |
3009 | -+ nm_log_dbg (LOGD_MB, "context %s added", path); |
3010 | -+} |
3011 | -+ |
3012 | -+static void |
3013 | -+ofono_context_removed (DBusGProxy *proxy, const char *path, gpointer user_data) |
3014 | -+{ |
3015 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3016 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3017 | -+ |
3018 | -+ nm_log_dbg (LOGD_MB, "context %s removed", path); |
3019 | -+} |
3020 | -+ |
3021 | -+static void |
3022 | -+ofono_properties_changed (DBusGProxy *proxy, |
3023 | -+ const char *key, |
3024 | -+ GValue *value, |
3025 | -+ gpointer user_data) |
3026 | -+{ |
3027 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3028 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3029 | -+ gboolean online; |
3030 | -+ |
3031 | -+ nm_log_dbg (LOGD_MB, "in %s: %s", __func__, key); |
3032 | -+ |
3033 | -+ if (g_strcmp0 (key, "Online") == 0 && G_VALUE_HOLDS_BOOLEAN (value)) { |
3034 | -+ |
3035 | -+ online = g_value_get_boolean (value); |
3036 | -+ if (online != priv->modem_online) { |
3037 | -+ priv->modem_online = online; |
3038 | -+ |
3039 | -+ nm_log_info (LOGD_MB, "(%s) modem is now %s", |
3040 | -+ nm_modem_get_path (NM_MODEM (self)), |
3041 | -+ online ? "Online" : "Offline"); |
3042 | -+ |
3043 | -+ update_modem_state (self); |
3044 | -+ } |
3045 | -+ |
3046 | -+ } else if (g_strcmp0 (key, "Interfaces") == 0 && G_VALUE_HOLDS_BOXED (value)) { |
3047 | -+ gboolean found_simmanager = FALSE; |
3048 | -+ gboolean found_conn_manager = FALSE; |
3049 | -+ int i; |
3050 | -+ |
3051 | -+ priv->interfaces = (char **) g_value_get_boxed (value); |
3052 | -+ nm_log_info (LOGD_MB, "(%s) updated available interfaces", nm_modem_get_path (NM_MODEM (self))); |
3053 | -+ |
3054 | -+ for (i = 0; priv->interfaces[i]; i++) { |
3055 | -+ if (g_strrstr (priv->interfaces[i], "SimManager")) |
3056 | -+ found_simmanager = TRUE; |
3057 | -+ if (g_strrstr (priv->interfaces[i], "ConnectionManager")) |
3058 | -+ found_conn_manager = TRUE; |
3059 | -+ } |
3060 | -+ |
3061 | -+ if (found_simmanager) { |
3062 | -+ if (!priv->simmanager_proxy) { |
3063 | -+ nm_log_info (LOGD_MB, "(%s): found new SimManager interface", |
3064 | -+ nm_modem_get_path (NM_MODEM (self))); |
3065 | -+ priv->simmanager_proxy = get_ofono_proxy (self, |
3066 | -+ nm_modem_get_path (NM_MODEM (self)), |
3067 | -+ OFONO_DBUS_INTERFACE_SIM_MANAGER); |
3068 | -+ dbus_g_proxy_add_signal (priv->simmanager_proxy, "PropertyChanged", |
3069 | -+ G_TYPE_STRING, G_TYPE_VALUE, |
3070 | -+ G_TYPE_INVALID); |
3071 | -+ dbus_g_proxy_connect_signal (priv->simmanager_proxy, "PropertyChanged", |
3072 | -+ G_CALLBACK (ofono_sim_properties_changed), |
3073 | -+ self, |
3074 | -+ NULL); |
3075 | -+ |
3076 | -+ dbus_g_proxy_begin_call_with_timeout (priv->simmanager_proxy, |
3077 | -+ "GetProperties", |
3078 | -+ get_ofono_sim_properties_done, |
3079 | -+ g_object_ref (self), NULL, 20000, |
3080 | -+ G_TYPE_INVALID); |
3081 | -+ } |
3082 | -+ } else if (priv->simmanager_proxy) { |
3083 | -+ nm_log_info (LOGD_MB, "(%s): SimManager interface disappeared", |
3084 | -+ nm_modem_get_path (NM_MODEM (self))); |
3085 | -+ g_object_unref (priv->simmanager_proxy); |
3086 | -+ priv->simmanager_proxy = NULL; |
3087 | -+ |
3088 | -+ g_free (priv->imsi); |
3089 | -+ priv->imsi = NULL; |
3090 | -+ |
3091 | -+ update_modem_state (self); |
3092 | -+ } |
3093 | -+ |
3094 | -+ if (found_conn_manager) { |
3095 | -+ if (!priv->connman_proxy) { |
3096 | -+ nm_log_info (LOGD_MB, "(%s): found new ConnectionManager interface", |
3097 | -+ nm_modem_get_path (NM_MODEM (self))); |
3098 | -+ |
3099 | -+ priv->connman_proxy = get_ofono_proxy (self, |
3100 | -+ nm_modem_get_path (NM_MODEM (self)), |
3101 | -+ OFONO_DBUS_INTERFACE_CONNECTION_MANAGER); |
3102 | -+ |
3103 | -+ if (priv->connman_proxy) { |
3104 | -+ |
3105 | -+ dbus_g_proxy_begin_call_with_timeout (priv->connman_proxy, |
3106 | -+ "GetProperties", |
3107 | -+ get_ofono_conn_manager_properties_done, |
3108 | -+ g_object_ref (self), NULL, 20000, |
3109 | -+ G_TYPE_INVALID); |
3110 | -+ |
3111 | -+ dbus_g_proxy_add_signal (priv->connman_proxy, "PropertyChanged", |
3112 | -+ G_TYPE_STRING, G_TYPE_VALUE, |
3113 | -+ G_TYPE_INVALID); |
3114 | -+ dbus_g_proxy_connect_signal (priv->connman_proxy, "PropertyChanged", |
3115 | -+ G_CALLBACK (ofono_conn_properties_changed), |
3116 | -+ self, |
3117 | -+ NULL); |
3118 | -+ |
3119 | -+ dbus_g_proxy_add_signal (priv->connman_proxy, "ContextAdded", |
3120 | -+ DBUS_TYPE_G_OBJECT_PATH, DBUS_TYPE_G_MAP_OF_VARIANT, |
3121 | -+ G_TYPE_INVALID); |
3122 | -+ dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextAdded", |
3123 | -+ G_CALLBACK (ofono_context_added), |
3124 | -+ self, |
3125 | -+ NULL); |
3126 | -+ dbus_g_proxy_add_signal (priv->connman_proxy, "ContextRemoved", |
3127 | -+ DBUS_TYPE_G_OBJECT_PATH, |
3128 | -+ G_TYPE_INVALID); |
3129 | -+ dbus_g_proxy_connect_signal (priv->connman_proxy, "ContextRemoved", |
3130 | -+ G_CALLBACK (ofono_context_removed), |
3131 | -+ self, |
3132 | -+ NULL); |
3133 | -+ } |
3134 | -+ } |
3135 | -+ } else if (priv->connman_proxy) { |
3136 | -+ nm_log_info (LOGD_MB, "(%s): ConnectionManager interface disappeared", |
3137 | -+ nm_modem_get_path (NM_MODEM (self))); |
3138 | -+ g_object_unref (priv->connman_proxy); |
3139 | -+ priv->connman_proxy = NULL; |
3140 | -+ |
3141 | -+ /* The connection manager proxy disappeared, we should |
3142 | -+ * consider the modem disabled. |
3143 | -+ */ |
3144 | -+ priv->gprs_attached = FALSE; |
3145 | -+ |
3146 | -+ update_modem_state (self); |
3147 | -+ } |
3148 | -+ } |
3149 | -+} |
3150 | -+ |
3151 | -+NMModem * |
3152 | -+nm_modem_ofono_new (const char *path) |
3153 | -+{ |
3154 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3155 | -+ g_return_val_if_fail (path != NULL, NULL); |
3156 | -+ |
3157 | -+ nm_log_dbg (LOGD_MB, "in %s: path %s", __func__, path); |
3158 | -+ |
3159 | -+ return (NMModem *) g_object_new (NM_TYPE_MODEM_OFONO, |
3160 | -+ NM_MODEM_PATH, path, |
3161 | -+ NM_MODEM_UID, (path + 1), |
3162 | -+ NM_MODEM_DEVICE_ID, (path + 1), |
3163 | -+ NM_MODEM_CONTROL_PORT, "ofono", /* mandatory */ |
3164 | -+ NM_MODEM_DRIVER, "ofono", |
3165 | -+ NM_MODEM_STATE, NM_MODEM_STATE_INITIALIZING, |
3166 | -+ NULL); |
3167 | -+} |
3168 | -+ |
3169 | -+static void |
3170 | -+stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) |
3171 | -+{ |
3172 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3173 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3174 | -+ GError *error = NULL; |
3175 | -+ |
3176 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3177 | -+ |
3178 | -+ if (priv->connect_properties) { |
3179 | -+ g_hash_table_destroy (priv->connect_properties); |
3180 | -+ priv->connect_properties = NULL; |
3181 | -+ } |
3182 | -+ |
3183 | -+ if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) { |
3184 | -+ nm_log_warn (LOGD_MB, "OFONO connection failed: (%d) %s", |
3185 | -+ error ? error->code : -1, |
3186 | -+ error && error->message ? error->message : "(unknown)"); |
3187 | -+ |
3188 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
3189 | -+ NM_DEVICE_STATE_REASON_MODEM_BUSY); |
3190 | -+ |
3191 | -+ /* |
3192 | -+ * FIXME: add code to check for InProgress so that the |
3193 | -+ * connection doesn't continue to try and activate, |
3194 | -+ * leading to the connection being disabled, and a 5m |
3195 | -+ * timeout... |
3196 | -+ */ |
3197 | -+ |
3198 | -+ g_error_free (error); |
3199 | -+ } |
3200 | -+} |
3201 | -+ |
3202 | -+static void |
3203 | -+ofono_context_get_ip_properties (NMModemOfono *self) |
3204 | -+{ |
3205 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3206 | -+ NMPlatformIP4Address addr; |
3207 | -+ NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; |
3208 | -+ GHashTable *properties, *ip_settings; |
3209 | -+ GError *error = NULL; |
3210 | -+ GType prop_dict; |
3211 | -+ const gchar *address_string, *gateway_string, *netmask_string, *iface; |
3212 | -+ gchar **dns; |
3213 | -+ const gchar *mms_proxy; |
3214 | -+ gpointer settings; |
3215 | -+ gboolean ret = FALSE; |
3216 | -+ guint32 address_network, gateway_network; |
3217 | -+ guint i; |
3218 | -+ guint prefix = 0; |
3219 | -+ |
3220 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3221 | -+ |
3222 | -+ prop_dict = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); |
3223 | -+ dbus_g_proxy_call_with_timeout (priv->context_proxy, |
3224 | -+ "GetProperties", |
3225 | -+ 20000, &error, |
3226 | -+ G_TYPE_INVALID, |
3227 | -+ prop_dict, &properties, |
3228 | -+ G_TYPE_INVALID); |
3229 | -+ |
3230 | -+ if (!error) { |
3231 | -+ settings = g_hash_table_lookup (properties, "Settings"); |
3232 | -+ if (settings && G_VALUE_HOLDS_BOXED (settings)) { |
3233 | -+ ip_settings = (GHashTable*) g_value_get_boxed (settings); |
3234 | -+ |
3235 | -+ if (nm_modem_get_state (NM_MODEM (self)) == NM_MODEM_STATE_CONNECTED |
3236 | -+ && g_hash_table_size(ip_settings) <= 0) { |
3237 | -+ g_signal_emit_by_name (self, NM_MODEM_PPP_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED); |
3238 | -+ return; |
3239 | -+ } |
3240 | -+ |
3241 | -+ nm_log_info (LOGD_MB, "(%s): IPv4 static configuration:", |
3242 | -+ nm_modem_get_uid (NM_MODEM (self))); |
3243 | -+ |
3244 | -+ iface = g_value_get_string (g_hash_table_lookup (ip_settings, "Interface")); |
3245 | -+ if (iface) |
3246 | -+ g_object_set (self, NM_MODEM_DATA_PORT, iface, |
3247 | -+ NM_MODEM_IP4_METHOD, NM_MODEM_IP_METHOD_STATIC, |
3248 | -+ NULL); |
3249 | -+ |
3250 | -+ if (priv->ip4_config) |
3251 | -+ g_object_unref (priv->ip4_config); |
3252 | -+ priv->ip4_config = nm_ip4_config_new (); |
3253 | -+ memset (&addr, 0, sizeof (addr)); |
3254 | -+ |
3255 | -+ address_string = g_value_get_string (g_hash_table_lookup (ip_settings, "Address")); |
3256 | -+ if (address_string) { |
3257 | -+ if (ip_string_to_network_address (address_string, &address_network)) { |
3258 | -+ addr.address = address_network; |
3259 | -+ addr.source = NM_IP_CONFIG_SOURCE_WWAN; |
3260 | -+ } |
3261 | -+ } else |
3262 | -+ goto out; |
3263 | -+ |
3264 | -+ /* retrieve netmask and convert to prefix value */ |
3265 | -+ netmask_string = g_value_get_string (g_hash_table_lookup (ip_settings, "Netmask")); |
3266 | -+ if (ip_string_to_network_address (netmask_string, &address_network)) { |
3267 | -+ prefix = nm_utils_ip4_netmask_to_prefix (address_network); |
3268 | -+ if (prefix > 0) |
3269 | -+ addr.plen = prefix; |
3270 | -+ } else |
3271 | -+ goto out; |
3272 | -+ |
3273 | -+ nm_log_info (LOGD_MB, " address %s/%d", address_string, prefix); |
3274 | -+ nm_ip4_config_add_address (priv->ip4_config, &addr); |
3275 | -+ |
3276 | -+ gateway_string = g_value_get_string (g_hash_table_lookup (ip_settings, "Gateway")); |
3277 | -+ if (gateway_string) { |
3278 | -+ if (ip_string_to_network_address (gateway_string, &gateway_network)) { |
3279 | -+ nm_log_info (LOGD_MB, " gateway %s", gateway_string); |
3280 | -+ nm_ip4_config_set_gateway (priv->ip4_config, gateway_network); |
3281 | -+ } |
3282 | -+ } else |
3283 | -+ goto out; |
3284 | -+ |
3285 | -+ /* DNS servers */ |
3286 | -+ dns = (char **) g_value_get_boxed (g_hash_table_lookup (ip_settings, "DomainNameServers")); |
3287 | -+ for (i = 0; dns[i]; i++) { |
3288 | -+ if ( ip_string_to_network_address (dns[i], &address_network) |
3289 | -+ && address_network > 0) { |
3290 | -+ nm_ip4_config_add_nameserver (priv->ip4_config, address_network); |
3291 | -+ nm_log_info (LOGD_MB, " DNS %s", dns[i]); |
3292 | -+ } |
3293 | -+ } |
3294 | -+ |
3295 | -+ /* Handle the case for a shared internet and MMS context */ |
3296 | -+ mms_proxy = g_value_get_string (g_hash_table_lookup (properties, "MessageProxy")); |
3297 | -+ if (mms_proxy) { |
3298 | -+ nm_log_info (LOGD_MB, " mms proxy: %s", mms_proxy); |
3299 | -+ |
3300 | -+ /* If the value can't be mapped to a guint32, it's probably not |
3301 | -+ * an IP address; so we could access it via *any* internet |
3302 | -+ * connection anyway, no need for a specific host route. |
3303 | -+ */ |
3304 | -+ if (ip_string_to_network_address (mms_proxy, &address_network)) { |
3305 | -+ NMPlatformIP4Route mms_route; |
3306 | -+ |
3307 | -+ memset (&mms_route, 0, sizeof (mms_route)); |
3308 | -+ mms_route.network = address_network; |
3309 | -+ mms_route.plen = 32; |
3310 | -+ mms_route.gateway = gateway_network; |
3311 | -+ |
3312 | -+ /* Setting a very low metric as MMS should go through |
3313 | -+ * the 3G connection... |
3314 | -+ */ |
3315 | -+ mms_route.metric = 1; |
3316 | -+ |
3317 | -+ nm_ip4_config_add_route (priv->ip4_config, &mms_route); |
3318 | -+ } |
3319 | -+ } |
3320 | -+ |
3321 | -+ ret = TRUE; |
3322 | -+ } |
3323 | -+ } |
3324 | -+ |
3325 | -+out: |
3326 | -+ if (!ret) { |
3327 | -+ if (error) { |
3328 | -+ reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; |
3329 | -+ g_clear_error (&error); |
3330 | -+ } else { |
3331 | -+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; |
3332 | -+ } |
3333 | -+ } |
3334 | -+ |
3335 | -+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) |
3336 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, ret, reason); |
3337 | -+} |
3338 | -+ |
3339 | -+static void |
3340 | -+context_properties_changed (DBusGProxy *proxy, |
3341 | -+ const char *key, |
3342 | -+ GValue *value, |
3343 | -+ gpointer user_data) |
3344 | -+{ |
3345 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3346 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3347 | -+ |
3348 | -+ if (g_strcmp0("Settings", key) == 0) { |
3349 | -+ ofono_context_get_ip_properties (self); |
3350 | -+ } |
3351 | -+} |
3352 | -+ |
3353 | -+static void |
3354 | -+do_context_activate (NMModemOfono *self, char *context_path) |
3355 | -+{ |
3356 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3357 | -+ GValue value = G_VALUE_INIT; |
3358 | -+ |
3359 | -+ g_return_val_if_fail (self != NULL, FALSE); |
3360 | -+ g_return_val_if_fail (NM_IS_MODEM_OFONO (self), FALSE); |
3361 | -+ |
3362 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3363 | -+ |
3364 | -+ g_value_init (&value, G_TYPE_BOOLEAN); |
3365 | -+ g_value_set_boolean (&value, TRUE); |
3366 | -+ |
3367 | -+ if (priv->context_proxy) |
3368 | -+ g_object_unref (priv->context_proxy); |
3369 | -+ |
3370 | -+ priv->context_proxy = get_ofono_proxy (self, |
3371 | -+ context_path, |
3372 | -+ OFONO_DBUS_INTERFACE_CONNECTION_CONTEXT); |
3373 | -+ |
3374 | -+ if (!priv->context_proxy) { |
3375 | -+ nm_log_err (LOGD_MB, "could not bring up connection context proxy"); |
3376 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
3377 | -+ NM_DEVICE_STATE_REASON_MODEM_BUSY); |
3378 | -+ return; |
3379 | -+ } |
3380 | -+ |
3381 | -+ if (!priv->gprs_attached) { |
3382 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, |
3383 | -+ NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER); |
3384 | -+ return; |
3385 | -+ } |
3386 | -+ |
3387 | -+ if (priv->ip4_config) { |
3388 | -+ /* We have an old copy of the settings from a previous activation, |
3389 | -+ * clear it so that we can gate getting the IP config from oFono |
3390 | -+ * on whether or not we have already received them |
3391 | -+ */ |
3392 | -+ g_object_unref (priv->ip4_config); |
3393 | -+ priv->ip4_config = NULL; |
3394 | -+ } |
3395 | -+ |
3396 | -+ dbus_g_proxy_add_signal (priv->context_proxy, "PropertyChanged", |
3397 | -+ G_TYPE_STRING, G_TYPE_VALUE, |
3398 | -+ G_TYPE_INVALID); |
3399 | -+ dbus_g_proxy_connect_signal (priv->context_proxy, "PropertyChanged", |
3400 | -+ G_CALLBACK (context_properties_changed), |
3401 | -+ self, |
3402 | -+ NULL); |
3403 | -+ |
3404 | -+ dbus_g_proxy_begin_call_with_timeout (priv->context_proxy, |
3405 | -+ "SetProperty", stage1_prepare_done, |
3406 | -+ g_object_ref (self), NULL, 40000, |
3407 | -+ G_TYPE_STRING, "Active", |
3408 | -+ G_TYPE_VALUE, &value, |
3409 | -+ G_TYPE_INVALID); |
3410 | -+ |
3411 | -+} |
3412 | -+ |
3413 | -+static void |
3414 | -+context_set_property (gpointer key, gpointer value, gpointer user_data) |
3415 | -+{ |
3416 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3417 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3418 | -+ GValue val = G_VALUE_INIT; |
3419 | -+ |
3420 | -+ nm_log_dbg (LOGD_MB, "%s -- setting context prop: %s == %s", |
3421 | -+ __func__, |
3422 | -+ (char*)key, |
3423 | -+ (char*)value); |
3424 | -+ |
3425 | -+ g_value_init (&val, G_TYPE_STRING); |
3426 | -+ g_value_set_string (&val, (char*)value); |
3427 | -+ |
3428 | -+ if (!priv->property_error) { |
3429 | -+ dbus_g_proxy_call_with_timeout (priv->context_proxy, |
3430 | -+ "SetProperty", |
3431 | -+ 20000, |
3432 | -+ &priv->property_error, |
3433 | -+ G_TYPE_STRING, (char*)key, |
3434 | -+ G_TYPE_VALUE, &val, |
3435 | -+ G_TYPE_INVALID); |
3436 | -+ } else { |
3437 | -+ nm_log_warn (LOGD_MB, "could not set context property '%s': %s", (char*)key, |
3438 | -+ priv->property_error |
3439 | -+ && priv->property_error->message |
3440 | -+ ? priv->property_error->message : "(unknown)"); |
3441 | -+ } |
3442 | -+} |
3443 | -+ |
3444 | -+static void stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data); |
3445 | -+ |
3446 | -+static void |
3447 | -+stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) |
3448 | -+{ |
3449 | -+ NMModemOfono *self = NM_MODEM_OFONO (user_data); |
3450 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3451 | -+ GError *error = NULL; |
3452 | -+ |
3453 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3454 | -+ |
3455 | -+ if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { |
3456 | -+ if (priv->context_path) |
3457 | -+ do_context_activate (self, priv->context_path); |
3458 | -+ else |
3459 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); |
3460 | -+ } else { |
3461 | -+ nm_log_warn (LOGD_MB, "OFONO modem enable failed: (%d) %s", |
3462 | -+ error ? error->code : -1, |
3463 | -+ error && error->message ? error->message : "(unknown)"); |
3464 | -+ |
3465 | -+ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); |
3466 | -+ |
3467 | -+ g_error_free (error); |
3468 | -+ } |
3469 | -+ |
3470 | -+ g_object_unref (self); |
3471 | -+} |
3472 | -+ |
3473 | -+static GHashTable * |
3474 | -+create_connect_properties (NMConnection *connection) |
3475 | -+{ |
3476 | -+ NMSettingGsm *setting; |
3477 | -+ GHashTable *properties; |
3478 | -+ const char *str; |
3479 | -+ |
3480 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3481 | -+ |
3482 | -+ setting = nm_connection_get_setting_gsm (connection); |
3483 | -+ properties = g_hash_table_new (g_str_hash, g_str_equal); |
3484 | -+ |
3485 | -+ str = nm_setting_gsm_get_apn (setting); |
3486 | -+ if (str) |
3487 | -+ g_hash_table_insert (properties, "AccessPointName", g_strdup (str)); |
3488 | -+ |
3489 | -+ str = nm_setting_gsm_get_username (setting); |
3490 | -+ if (str) |
3491 | -+ g_hash_table_insert (properties, "Username", g_strdup (str)); |
3492 | -+ |
3493 | -+ str = nm_setting_gsm_get_password (setting); |
3494 | -+ if (str) |
3495 | -+ g_hash_table_insert (properties, "Password", g_strdup (str)); |
3496 | -+ |
3497 | -+ return properties; |
3498 | -+} |
3499 | -+ |
3500 | -+static NMActStageReturn |
3501 | -+act_stage1_prepare (NMModem *modem, |
3502 | -+ NMConnection *connection, |
3503 | -+ NMDeviceStateReason *reason) |
3504 | -+{ |
3505 | -+ NMModemOfono *self = NM_MODEM_OFONO (modem); |
3506 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3507 | -+ const char *context_id; |
3508 | -+ char *context_path; |
3509 | -+ char **id = NULL; |
3510 | -+ |
3511 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3512 | -+ |
3513 | -+ context_id = nm_connection_get_id (connection); |
3514 | -+ id = g_strsplit (context_id, "/", 0); |
3515 | -+ g_assert (id[2]); |
3516 | -+ |
3517 | -+ nm_log_dbg (LOGD_MB, " trying %s %s", id[1], id[2]); |
3518 | -+ |
3519 | -+ if (priv->context_path) |
3520 | -+ g_free (priv->context_path); |
3521 | -+ |
3522 | -+ priv->context_path = g_strdup_printf ("%s/%s", |
3523 | -+ nm_modem_get_path (modem), |
3524 | -+ id[2]); |
3525 | -+ g_strfreev (id); |
3526 | -+ |
3527 | -+ if (!priv->context_path) { |
3528 | -+ *reason = NM_DEVICE_STATE_REASON_GSM_APN_FAILED; |
3529 | -+ return NM_ACT_STAGE_RETURN_FAILURE; |
3530 | -+ } |
3531 | -+ |
3532 | -+ if (priv->connect_properties) |
3533 | -+ g_hash_table_destroy (priv->connect_properties); |
3534 | -+ priv->connect_properties = create_connect_properties (connection); |
3535 | -+ |
3536 | -+ nm_log_info (LOGD_MB, "(%s): activating context %s", |
3537 | -+ nm_modem_get_path (modem), |
3538 | -+ priv->context_path); |
3539 | -+ |
3540 | -+ if (nm_modem_get_state (modem) == NM_MODEM_STATE_REGISTERED) { |
3541 | -+ do_context_activate (self, priv->context_path); |
3542 | -+ } else { |
3543 | -+ nm_log_warn (LOGD_MB, "(%s): could not activate context, " |
3544 | -+ "modem is not registered.", |
3545 | -+ nm_modem_get_path (modem)); |
3546 | -+ *reason = NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER; |
3547 | -+ return NM_ACT_STAGE_RETURN_FAILURE; |
3548 | -+ } |
3549 | -+ |
3550 | -+ return NM_ACT_STAGE_RETURN_POSTPONE; |
3551 | -+} |
3552 | -+ |
3553 | -+static NMActStageReturn |
3554 | -+static_stage3_ip4_config_start (NMModem *_self, |
3555 | -+ NMActRequest *req, |
3556 | -+ NMDeviceStateReason *reason) |
3557 | -+{ |
3558 | -+ NMModemOfono *self = NM_MODEM_OFONO (_self); |
3559 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3560 | -+ NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; |
3561 | -+ GError *error = NULL; |
3562 | -+ |
3563 | -+ if (priv->ip4_config) { |
3564 | -+ g_signal_emit_by_name (self, NM_MODEM_IP4_CONFIG_RESULT, priv->ip4_config, error); |
3565 | -+ priv->ip4_config = NULL; |
3566 | -+ nm_modem_set_state (NM_MODEM (self), |
3567 | -+ NM_MODEM_STATE_CONNECTED, |
3568 | -+ nm_modem_state_to_string (NM_MODEM_STATE_CONNECTED)); |
3569 | -+ ret = NM_ACT_STAGE_RETURN_POSTPONE; |
3570 | -+ } |
3571 | -+ |
3572 | -+ return ret; |
3573 | -+} |
3574 | -+ |
3575 | -+static gboolean |
3576 | -+check_connection_compatible (NMModem *modem, |
3577 | -+ NMConnection *connection) |
3578 | -+{ |
3579 | -+ NMModemOfono *self = NM_MODEM_OFONO (modem); |
3580 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3581 | -+ NMSettingConnection *s_con; |
3582 | -+ NMSettingGsm *s_gsm; |
3583 | -+ const char *uuid; |
3584 | -+ const char *id; |
3585 | -+ |
3586 | -+ s_con = nm_connection_get_setting_connection (connection); |
3587 | -+ g_assert (s_con); |
3588 | -+ |
3589 | -+ uuid = nm_connection_get_uuid (connection); |
3590 | -+ |
3591 | -+ if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME)) { |
3592 | -+ nm_log_dbg (LOGD_MB, "%s isn't of the right type, skipping.", uuid); |
3593 | -+ return FALSE; |
3594 | -+ } |
3595 | -+ |
3596 | -+ s_gsm = nm_connection_get_setting_gsm (connection); |
3597 | -+ if (!s_gsm) |
3598 | -+ return FALSE; |
3599 | -+ |
3600 | -+ id = nm_connection_get_id (connection); |
3601 | -+ if (!g_strrstr (id, "/context")) { |
3602 | -+ nm_log_dbg (LOGD_MB, "%s (%s) isn't of the right type, skipping.", id, uuid); |
3603 | -+ return FALSE; |
3604 | -+ } |
3605 | -+ |
3606 | -+ if (! g_strrstr (id, priv->imsi)) { |
3607 | -+ nm_log_dbg (LOGD_MB, "%s (%s) isn't for the right SIM, skipping.", id, uuid); |
3608 | -+ return FALSE; |
3609 | -+ } |
3610 | -+ |
3611 | -+ nm_log_dbg (LOGD_MB, "%s (%s) looks compatible with IMSI %s", id, uuid, priv->imsi); |
3612 | -+ |
3613 | -+ return TRUE; |
3614 | -+} |
3615 | -+ |
3616 | -+static void |
3617 | -+get_ofono_properties_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) |
3618 | -+{ |
3619 | -+ NMModem *self = NM_MODEM (user_data); |
3620 | -+ GError *error = NULL; |
3621 | -+ GHashTable *properties = NULL; |
3622 | -+ GValue *value = NULL; |
3623 | -+ |
3624 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3625 | -+ |
3626 | -+ if (!dbus_g_proxy_end_call (proxy, call_id, &error, |
3627 | -+ DBUS_TYPE_G_MAP_OF_VARIANT, &properties, |
3628 | -+ G_TYPE_INVALID)) { |
3629 | -+ nm_log_warn (LOGD_MB, "failed get modem enabled state: (%d) %s", |
3630 | -+ error ? error->code : -1, |
3631 | -+ error && error->message ? error->message : "(unknown)"); |
3632 | -+ return; |
3633 | -+ } |
3634 | -+ |
3635 | -+ value = g_hash_table_lookup (properties, "Online"); |
3636 | -+ if (value) |
3637 | -+ ofono_properties_changed (NULL, "Online", value, self); |
3638 | -+ else |
3639 | -+ nm_log_warn (LOGD_MB, "failed get modem online state: unexpected reply type"); |
3640 | -+ g_value_unset (value); |
3641 | -+ |
3642 | -+ value = g_hash_table_lookup (properties, "Interfaces"); |
3643 | -+ if (value) |
3644 | -+ ofono_properties_changed (NULL, "Interfaces", value, self); |
3645 | -+ else |
3646 | -+ nm_log_warn (LOGD_MB, "failed get available oFono interfaces: unexpected reply type"); |
3647 | -+ g_value_unset (value); |
3648 | -+} |
3649 | -+ |
3650 | -+static void |
3651 | -+query_ofono_properties (NMModemOfono *self) |
3652 | -+{ |
3653 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3654 | -+ dbus_g_proxy_begin_call (NM_MODEM_OFONO_GET_PRIVATE (self)->modem_proxy, |
3655 | -+ "GetProperties", get_ofono_properties_done, |
3656 | -+ self, NULL, |
3657 | -+ G_TYPE_INVALID); |
3658 | -+} |
3659 | -+ |
3660 | -+static void |
3661 | -+get_capabilities (NMModem *_self, |
3662 | -+ NMDeviceModemCapabilities *modem_caps, |
3663 | -+ NMDeviceModemCapabilities *current_caps) |
3664 | -+{ |
3665 | -+ NMModemOfono *self = NM_MODEM_OFONO (_self); |
3666 | -+ NMDeviceModemCapabilities all_ofono_caps = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS; |
3667 | -+ |
3668 | -+ *modem_caps = all_ofono_caps; |
3669 | -+ *current_caps = all_ofono_caps; |
3670 | -+} |
3671 | -+ |
3672 | -+static void |
3673 | -+nm_modem_ofono_init (NMModemOfono *self) |
3674 | -+{ |
3675 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3676 | -+ |
3677 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3678 | -+ |
3679 | -+ priv->dbus_mgr = nm_dbus_manager_get (); |
3680 | -+ |
3681 | -+ priv->modem_proxy = NULL; |
3682 | -+ priv->connman_proxy = NULL; |
3683 | -+ priv->context_proxy = NULL; |
3684 | -+ priv->simmanager_proxy = NULL; |
3685 | -+ |
3686 | -+ priv->modem_online = FALSE; |
3687 | -+ priv->gprs_attached = FALSE; |
3688 | -+ |
3689 | -+ priv->ip4_config = NULL; |
3690 | -+} |
3691 | -+ |
3692 | -+static GObject* |
3693 | -+constructor (GType type, |
3694 | -+ guint n_construct_params, |
3695 | -+ GObjectConstructParam *construct_params) |
3696 | -+{ |
3697 | -+ GObject *object; |
3698 | -+ NMModemOfonoPrivate *priv; |
3699 | -+ DBusGConnection *bus; |
3700 | -+ |
3701 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3702 | -+ |
3703 | -+ object = G_OBJECT_CLASS (nm_modem_ofono_parent_class)->constructor (type, n_construct_params, construct_params); |
3704 | -+ if (!object) |
3705 | -+ return NULL; |
3706 | -+ |
3707 | -+ priv = NM_MODEM_OFONO_GET_PRIVATE (object); |
3708 | -+ bus = nm_dbus_manager_get_connection (priv->dbus_mgr); |
3709 | -+ priv->modem_proxy = get_ofono_proxy (NM_MODEM_OFONO (object), |
3710 | -+ nm_modem_get_path (NM_MODEM (object)), |
3711 | -+ OFONO_DBUS_INTERFACE_MODEM); |
3712 | -+ |
3713 | -+ dbus_g_object_register_marshaller (g_cclosure_marshal_generic, |
3714 | -+ G_TYPE_NONE, |
3715 | -+ G_TYPE_STRING, G_TYPE_VALUE, |
3716 | -+ G_TYPE_INVALID); |
3717 | -+ dbus_g_proxy_add_signal (priv->modem_proxy, "PropertyChanged", |
3718 | -+ G_TYPE_STRING, G_TYPE_VALUE, |
3719 | -+ G_TYPE_INVALID); |
3720 | -+ dbus_g_proxy_connect_signal (priv->modem_proxy, "PropertyChanged", |
3721 | -+ G_CALLBACK (ofono_properties_changed), |
3722 | -+ object, |
3723 | -+ NULL); |
3724 | -+ |
3725 | -+ query_ofono_properties (NM_MODEM_OFONO (object)); |
3726 | -+ |
3727 | -+ return object; |
3728 | -+} |
3729 | -+ |
3730 | -+static void |
3731 | -+dispose (GObject *object) |
3732 | -+{ |
3733 | -+ NMModemOfono *self = NM_MODEM_OFONO (object); |
3734 | -+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self); |
3735 | -+ |
3736 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3737 | -+ |
3738 | -+ if (priv->connect_properties) { |
3739 | -+ g_hash_table_destroy (priv->connect_properties); |
3740 | -+ priv->connect_properties = NULL; |
3741 | -+ } |
3742 | -+ |
3743 | -+ if (priv->ip4_config) |
3744 | -+ g_clear_object (&priv->ip4_config); |
3745 | -+ |
3746 | -+ if (priv->modem_proxy) |
3747 | -+ g_clear_object (&priv->modem_proxy); |
3748 | -+ if (priv->connman_proxy) |
3749 | -+ g_clear_object (&priv->connman_proxy); |
3750 | -+ if (priv->context_proxy) |
3751 | -+ g_clear_object (&priv->context_proxy); |
3752 | -+ |
3753 | -+ if (priv->imsi) { |
3754 | -+ g_free (priv->imsi); |
3755 | -+ priv->imsi = NULL; |
3756 | -+ } |
3757 | -+ |
3758 | -+ G_OBJECT_CLASS (nm_modem_ofono_parent_class)->dispose (object); |
3759 | -+} |
3760 | -+ |
3761 | -+static void |
3762 | -+nm_modem_ofono_class_init (NMModemOfonoClass *klass) |
3763 | -+{ |
3764 | -+ GObjectClass *object_class = G_OBJECT_CLASS (klass); |
3765 | -+ NMModemClass *modem_class = NM_MODEM_CLASS (klass); |
3766 | -+ |
3767 | -+ nm_log_dbg (LOGD_MB, "in %s", __func__); |
3768 | -+ |
3769 | -+ g_type_class_add_private (object_class, sizeof (NMModemOfonoPrivate)); |
3770 | -+ |
3771 | -+ /* Virtual methods */ |
3772 | -+ object_class->constructor = constructor; |
3773 | -+ object_class->dispose = dispose; |
3774 | -+ |
3775 | -+ modem_class->get_capabilities = get_capabilities; |
3776 | -+ modem_class->disconnect = disconnect; |
3777 | -+ modem_class->disconnect_finish = disconnect_finish; |
3778 | -+ modem_class->deactivate_cleanup = deactivate_cleanup; |
3779 | -+ modem_class->check_connection_compatible = check_connection_compatible; |
3780 | -+ modem_class->act_stage1_prepare = act_stage1_prepare; |
3781 | -+ modem_class->static_stage3_ip4_config_start = static_stage3_ip4_config_start; |
3782 | -+} |
3783 | -+ |
3784 | -Index: b/src/devices/wwan/nm-modem-ofono.h |
3785 | -=================================================================== |
3786 | ---- /dev/null |
3787 | -+++ b/src/devices/wwan/nm-modem-ofono.h |
3788 | -@@ -0,0 +1,64 @@ |
3789 | -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
3790 | -+/* NetworkManager -- Network link manager |
3791 | -+ * |
3792 | -+ * This program is free software; you can redistribute it and/or modify |
3793 | -+ * it under the terms of the GNU General Public License as published by |
3794 | -+ * the Free Software Foundation; either version 2 of the License, or |
3795 | -+ * (at your option) any later version. |
3796 | -+ * |
3797 | -+ * This program is distributed in the hope that it will be useful, |
3798 | -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3799 | -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3800 | -+ * GNU General Public License for more details. |
3801 | -+ * |
3802 | -+ * You should have received a copy of the GNU General Public License along |
3803 | -+ * with this program; if not, write to the Free Software Foundation, Inc., |
3804 | -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
3805 | -+ * |
3806 | -+ * Copyright (C) 2013 - Canonical Ltd. |
3807 | -+ */ |
3808 | -+ |
3809 | -+#ifndef NM_MODEM_OFONO_H |
3810 | -+#define NM_MODEM_OFONO_H |
3811 | -+ |
3812 | -+#include <nm-modem.h> |
3813 | -+ |
3814 | -+G_BEGIN_DECLS |
3815 | -+ |
3816 | -+#define NM_TYPE_MODEM_OFONO (nm_modem_ofono_get_type ()) |
3817 | -+#define NM_MODEM_OFONO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_OFONO, NMModemOfono)) |
3818 | -+#define NM_IS_MODEM_OFONO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_OFONO)) |
3819 | -+#define NM_MODEM_OFONO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_OFONO, NMModemOfonoClass)) |
3820 | -+#define NM_IS_MODEM_OFONO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_OFONO)) |
3821 | -+#define NM_MODEM_OFONO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_OFONO, NMModemOfonoClass)) |
3822 | -+#define NM_MODEM_OFONO_MODEM "modem" |
3823 | -+ |
3824 | -+#define OFONO_DBUS_SERVICE "org.ofono" |
3825 | -+#define OFONO_DBUS_PATH "/" |
3826 | -+#define OFONO_DBUS_INTERFACE "org.ofono.Manager" |
3827 | -+#define OFONO_DBUS_INTERFACE_MODEM "org.ofono.Modem" |
3828 | -+#define OFONO_DBUS_INTERFACE_CONNECTION_MANAGER "org.ofono.ConnectionManager" |
3829 | -+#define OFONO_DBUS_INTERFACE_CONNECTION_CONTEXT "org.ofono.ConnectionContext" |
3830 | -+#define OFONO_DBUS_INTERFACE_SIM_MANAGER "org.ofono.SimManager" |
3831 | -+ |
3832 | -+typedef enum { |
3833 | -+ NM_OFONO_ERROR_CONNECTION_NOT_OFONO = 0, /*< nick=ConnectionNotOfono >*/ |
3834 | -+ NM_OFONO_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/ |
3835 | -+ NM_OFONO_ERROR_CONNECTION_INCOMPATIBLE, /*< nick=ConnectionIncompatible >*/ |
3836 | -+} NMOfonoError; |
3837 | -+ |
3838 | -+typedef struct { |
3839 | -+ NMModem parent; |
3840 | -+} NMModemOfono; |
3841 | -+ |
3842 | -+typedef struct { |
3843 | -+ NMModemClass parent; |
3844 | -+} NMModemOfonoClass; |
3845 | -+ |
3846 | -+GType nm_modem_ofono_get_type (void); |
3847 | -+ |
3848 | -+NMModem *nm_modem_ofono_new (const char *path); |
3849 | -+ |
3850 | -+G_END_DECLS |
3851 | -+ |
3852 | -+#endif /* NM_MODEM_OFONO_H */ |
3853 | -Index: b/src/NetworkManagerUtils.c |
3854 | -=================================================================== |
3855 | ---- a/src/NetworkManagerUtils.c |
3856 | -+++ b/src/NetworkManagerUtils.c |
3857 | -@@ -2650,7 +2650,13 @@ _get_property_path (const char *ifname, |
3858 | - ipv6 ? IPV6_PROPERTY_DIR : IPV4_PROPERTY_DIR, |
3859 | - ifname, |
3860 | - property); |
3861 | -- g_assert (len < sizeof (path) - 1); |
3862 | -+ |
3863 | -+ /* Ubuntu: don't assert, but log about the inconsistent size. */ |
3864 | -+ if (len > sizeof (path) - 1) |
3865 | -+ nm_log_warn (LOGD_CORE, |
3866 | -+ "IPv6 property path is too long: '" |
3867 | -+ IPV6_PROPERTY_DIR "%s/%s'", |
3868 | -+ ifname, property); |
3869 | - |
3870 | - return path; |
3871 | - } |
3872 | -@@ -2707,9 +2713,15 @@ ASSERT_VALID_PATH_COMPONENT (const char |
3873 | - fail: |
3874 | - nm_log_err (LOGD_CORE, "Failed asserting path component: %s%s%s", |
3875 | - NM_PRINT_FMT_QUOTED (name, "\"", name, "\"", "(null)")); |
3876 | -- g_error ("FATAL: Failed asserting path component: %s%s%s", |
3877 | -- NM_PRINT_FMT_QUOTED (name, "\"", name, "\"", "(null)")); |
3878 | -- g_assert_not_reached (); |
3879 | -+ |
3880 | -+ /* Ubuntu: Don't outright fail, just return the name again. It's |
3881 | -+ * logged as being invalid, which is enough. |
3882 | -+ * There is a use of slashes in paths for oFono modems, which are |
3883 | -+ * actually valid paths to refer to an oFono modem, just don't map to |
3884 | -+ * anything on the filesystem. The following calls to sysctl paths can |
3885 | -+ * (and will) fail, but that's fine. |
3886 | -+ */ |
3887 | -+ return name; |
3888 | - } |
3889 | - |
3890 | - gboolean |
3891 | -Index: b/src/devices/wwan/nm-device-modem.c |
3892 | -=================================================================== |
3893 | ---- a/src/devices/wwan/nm-device-modem.c |
3894 | -+++ b/src/devices/wwan/nm-device-modem.c |
3895 | -@@ -280,6 +280,16 @@ modem_state_cb (NMModem *modem, |
3896 | - } |
3897 | - } |
3898 | - |
3899 | -+ if (dev_state >= NM_DEVICE_STATE_DISCONNECTED && |
3900 | -+ new_state == NM_MODEM_STATE_REGISTERED && old_state < NM_MODEM_STATE_REGISTERED) { |
3901 | -+ |
3902 | -+ nm_log_info (LOGD_MB, "(%s): modem re-registered; re-checking autoconnect", |
3903 | -+ nm_device_get_iface (device)); |
3904 | -+ |
3905 | -+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL); |
3906 | -+ nm_device_emit_recheck_auto_activate (device); |
3907 | -+ } |
3908 | -+ |
3909 | - if (new_state < NM_MODEM_STATE_CONNECTING && |
3910 | - old_state >= NM_MODEM_STATE_CONNECTING && |
3911 | - dev_state >= NM_DEVICE_STATE_NEED_AUTH && |
3912 | -@@ -343,6 +353,14 @@ device_state_changed (NMDevice *device, |
3913 | - nm_modem_state_to_string (nm_modem_get_state (priv->modem))); |
3914 | - } |
3915 | - |
3916 | -+ /* Block autoconnect until the modem is registered again */ |
3917 | -+ if (new_state == NM_DEVICE_STATE_FAILED && nm_modem_get_state (priv->modem) == NM_MODEM_STATE_SEARCHING) { |
3918 | -+ nm_log_info (LOGD_MB, "(%s): modem searching; disabling autoconnect", |
3919 | -+ nm_device_get_iface (device)); |
3920 | -+ |
3921 | -+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL); |
3922 | -+ } |
3923 | -+ |
3924 | - nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); |
3925 | - |
3926 | - switch (reason) { |
3927 | |
3928 | === removed file 'debian/patches/0002-Force-online-state-with-unmanaged-devices.patch' |
3929 | --- debian/patches/0002-Force-online-state-with-unmanaged-devices.patch 2015-08-20 01:07:00 +0000 |
3930 | +++ debian/patches/0002-Force-online-state-with-unmanaged-devices.patch 1970-01-01 00:00:00 +0000 |
3931 | @@ -1,194 +0,0 @@ |
3932 | -From: Michael Biebl <biebl@debian.org> |
3933 | -Date: Wed, 2 Apr 2014 03:15:53 +0200 |
3934 | -Subject: Force online state with unmanaged devices |
3935 | - |
3936 | -If we have unmanaged devices in /e/n/i, monitor the ifupdown state file |
3937 | -and in case we find active interfaces besides lo, forcefully set the |
3938 | -online state to CONNECTED. |
3939 | - |
3940 | -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512286 |
3941 | ---- |
3942 | - src/nm-manager.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
3943 | - 1 file changed, 121 insertions(+) |
3944 | - |
3945 | -Index: b/src/nm-manager.c |
3946 | -=================================================================== |
3947 | ---- a/src/nm-manager.c |
3948 | -+++ b/src/nm-manager.c |
3949 | -@@ -62,6 +62,8 @@ |
3950 | - #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" |
3951 | - #define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" |
3952 | - |
3953 | -+#define IFUPDOWN_STATE_FILE "/run/network/ifstate" |
3954 | -+ |
3955 | - static gboolean impl_manager_get_devices (NMManager *manager, |
3956 | - GPtrArray **devices, |
3957 | - GError **err); |
3958 | -@@ -191,6 +193,11 @@ typedef struct { |
3959 | - GFileMonitor *fw_monitor; |
3960 | - guint fw_changed_id; |
3961 | - |
3962 | -+ /* ifupdown state file monitor */ |
3963 | -+ GFileMonitor *ifstate_monitor; |
3964 | -+ guint ifstate_monitor_id; |
3965 | -+ gboolean ifstate_force_online; |
3966 | -+ |
3967 | - guint timestamp_update_id; |
3968 | - |
3969 | - gboolean startup; |
3970 | -@@ -657,6 +664,29 @@ find_best_device_state (NMManager *manag |
3971 | - return best_state; |
3972 | - } |
3973 | - |
3974 | -+static NMState |
3975 | -+find_unmanaged_state (NMManager *manager, NMState current_state) |
3976 | -+{ |
3977 | -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); |
3978 | -+ NMState new_state = current_state; |
3979 | -+ GSList *iter; |
3980 | -+ |
3981 | -+ for (iter = priv->devices; iter; iter = iter->next) { |
3982 | -+ NMDevice *dev = NM_DEVICE (iter->data); |
3983 | -+ NMDeviceState state = nm_device_get_state (dev); |
3984 | -+ |
3985 | -+ |
3986 | -+ if (state == NM_DEVICE_STATE_UNMANAGED) { |
3987 | -+ const char *iface = nm_device_get_ip_iface (dev); |
3988 | -+ if (priv->ifstate_force_online) { |
3989 | -+ new_state = NM_STATE_CONNECTED_GLOBAL; |
3990 | -+ nm_log_dbg (LOGD_CORE, "Unmanaged device found: %s; state CONNECTED forced.", iface); |
3991 | -+ } |
3992 | -+ } |
3993 | -+ } |
3994 | -+ return new_state; |
3995 | -+} |
3996 | -+ |
3997 | - static void |
3998 | - nm_manager_update_state (NMManager *manager) |
3999 | - { |
4000 | -@@ -671,6 +701,8 @@ nm_manager_update_state (NMManager *mana |
4001 | - new_state = NM_STATE_ASLEEP; |
4002 | - else |
4003 | - new_state = find_best_device_state (manager); |
4004 | -+ if (new_state != NM_STATE_CONNECTED_GLOBAL) |
4005 | -+ new_state = find_unmanaged_state (manager, new_state); |
4006 | - |
4007 | - nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL); |
4008 | - |
4009 | -@@ -4128,6 +4160,65 @@ start_factory (NMDeviceFactory *factory, |
4010 | - nm_device_factory_start (factory); |
4011 | - } |
4012 | - |
4013 | -+static void |
4014 | -+check_ifstate_file (gpointer user_data) |
4015 | -+{ |
4016 | -+ NMManager *self = NM_MANAGER (user_data); |
4017 | -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); |
4018 | -+ GIOChannel *channel; |
4019 | -+ gchar *line; |
4020 | -+ gboolean online = FALSE; |
4021 | -+ |
4022 | -+ channel = g_io_channel_new_file (IFUPDOWN_STATE_FILE, "r", NULL); |
4023 | -+ if (!channel) { |
4024 | -+ nm_log_warn (LOGD_CORE, "Error: failed to open %s", IFUPDOWN_STATE_FILE); |
4025 | -+ return; |
4026 | -+ } |
4027 | -+ |
4028 | -+ while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL) |
4029 | -+ != G_IO_STATUS_EOF && !online) { |
4030 | -+ g_strstrip (line); |
4031 | -+ if (strlen (line) > 0 && g_strcmp0 (line, "lo=lo") != 0) { |
4032 | -+ online = TRUE; |
4033 | -+ } |
4034 | -+ g_free (line); |
4035 | -+ } |
4036 | -+ |
4037 | -+ g_io_channel_shutdown (channel, FALSE, NULL); |
4038 | -+ g_io_channel_unref (channel); |
4039 | -+ |
4040 | -+ if (priv->ifstate_force_online != online) { |
4041 | -+ priv->ifstate_force_online = online; |
4042 | -+ nm_manager_update_state (self); |
4043 | -+ } |
4044 | -+} |
4045 | -+ |
4046 | -+static void |
4047 | -+ifstate_file_changed (GFileMonitor *monitor, |
4048 | -+ GFile *file, |
4049 | -+ GFile *other_file, |
4050 | -+ GFileMonitorEvent event_type, |
4051 | -+ gpointer user_data) |
4052 | -+{ |
4053 | -+ NMManager *self = NM_MANAGER (user_data); |
4054 | -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); |
4055 | -+ |
4056 | -+ switch (event_type) { |
4057 | -+// case G_FILE_MONITOR_EVENT_CREATED: |
4058 | -+//#if GLIB_CHECK_VERSION(2,23,4) |
4059 | -+// case G_FILE_MONITOR_EVENT_MOVED: |
4060 | -+//#endif |
4061 | -+// case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED: |
4062 | -+ case G_FILE_MONITOR_EVENT_CHANGED: |
4063 | -+ case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: |
4064 | -+ nm_log_dbg (LOGD_CORE, "ifupdown state file %s was changed", IFUPDOWN_STATE_FILE); |
4065 | -+ check_ifstate_file (user_data); |
4066 | -+ break; |
4067 | -+ default: |
4068 | -+ break; |
4069 | -+ } |
4070 | -+} |
4071 | -+ |
4072 | - void |
4073 | - nm_manager_start (NMManager *self) |
4074 | - { |
4075 | -@@ -4174,6 +4265,9 @@ nm_manager_start (NMManager *self) |
4076 | - system_create_virtual_devices (self); |
4077 | - |
4078 | - check_if_startup_complete (self); |
4079 | -+ |
4080 | -+ /* Trigger ifupdown state file check */ |
4081 | -+ check_ifstate_file (self); |
4082 | - } |
4083 | - |
4084 | - void |
4085 | -@@ -4877,6 +4971,22 @@ nm_manager_init (NMManager *manager) |
4086 | - KERNEL_FIRMWARE_DIR); |
4087 | - } |
4088 | - |
4089 | -+ /* Monitor the ifupdown state file */ |
4090 | -+ file = g_file_new_for_path (IFUPDOWN_STATE_FILE); |
4091 | -+ priv->ifstate_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); |
4092 | -+ g_object_unref (file); |
4093 | -+ |
4094 | -+ if (priv->ifstate_monitor) { |
4095 | -+ priv->ifstate_monitor_id = g_signal_connect (priv->ifstate_monitor, "changed", |
4096 | -+ G_CALLBACK (ifstate_file_changed), |
4097 | -+ manager); |
4098 | -+ nm_log_info (LOGD_CORE, "monitoring ifupdown state file '%s'.", |
4099 | -+ IFUPDOWN_STATE_FILE); |
4100 | -+ } else { |
4101 | -+ nm_log_warn (LOGD_CORE, "failed to monitor ifupdown state file '%s'.", |
4102 | -+ IFUPDOWN_STATE_FILE); |
4103 | -+ } |
4104 | -+ |
4105 | - /* Update timestamps in active connections */ |
4106 | - priv->timestamp_update_id = g_timeout_add_seconds (300, (GSourceFunc) periodic_update_active_connection_timestamps, manager); |
4107 | - } |
4108 | -@@ -5086,6 +5196,17 @@ dispose (GObject *object) |
4109 | - g_clear_object (&priv->fw_monitor); |
4110 | - } |
4111 | - |
4112 | -+ if (priv->ifstate_monitor) { |
4113 | -+ if (priv->ifstate_monitor_id) |
4114 | -+ g_signal_handler_disconnect (priv->ifstate_monitor, priv->ifstate_monitor_id); |
4115 | -+ |
4116 | -+ if (priv->ifstate_force_online) |
4117 | -+ g_source_remove (priv->ifstate_force_online); |
4118 | -+ |
4119 | -+ g_file_monitor_cancel (priv->ifstate_monitor); |
4120 | -+ g_object_unref (priv->ifstate_monitor); |
4121 | -+ } |
4122 | -+ |
4123 | - nm_device_factory_manager_for_each_factory (_deinit_device_factory, manager); |
4124 | - |
4125 | - if (priv->timestamp_update_id) { |
4126 | |
4127 | === removed file 'debian/patches/0002-fixup-libnm-libnm-util-add-Wi-Fi-powersave-property.patch' |
4128 | --- debian/patches/0002-fixup-libnm-libnm-util-add-Wi-Fi-powersave-property.patch 2015-08-20 01:07:00 +0000 |
4129 | +++ debian/patches/0002-fixup-libnm-libnm-util-add-Wi-Fi-powersave-property.patch 1970-01-01 00:00:00 +0000 |
4130 | @@ -1,30 +0,0 @@ |
4131 | -From fcd3642ef374927a44ae83a4c385c0bcd35e2f95 Mon Sep 17 00:00:00 2001 |
4132 | -From: Dan Williams <dcbw@redhat.com> |
4133 | -Date: Mon, 17 Nov 2014 09:12:17 -0600 |
4134 | -Subject: [PATCH 2/5] fixup! libnm/libnm-util: add Wi-Fi 'powersave' property |
4135 | - |
4136 | ---- |
4137 | - libnm-util/nm-setting-wireless.c | 10 ---------- |
4138 | - 1 file changed, 10 deletions(-) |
4139 | - |
4140 | -Index: b/libnm-util/nm-setting-wireless.c |
4141 | -=================================================================== |
4142 | ---- a/libnm-util/nm-setting-wireless.c |
4143 | -+++ b/libnm-util/nm-setting-wireless.c |
4144 | -@@ -876,16 +876,6 @@ verify (NMSetting *setting, GSList *all_ |
4145 | - } |
4146 | - } |
4147 | - |
4148 | -- if (priv->powersave > 1) { |
4149 | -- g_set_error (error, |
4150 | -- NM_SETTING_WIRELESS_ERROR, |
4151 | -- NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, |
4152 | -- _("'%u' is not a valid powersave value"), |
4153 | -- priv->powersave); |
4154 | -- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_POWERSAVE); |
4155 | -- return FALSE; |
4156 | -- } |
4157 | -- |
4158 | - return TRUE; |
4159 | - } |
4160 | - |
4161 | |
4162 | === removed file 'debian/patches/0002-wifi-cull-the-scan-list-before-signalling-ScanDone-b.patch' |
4163 | --- debian/patches/0002-wifi-cull-the-scan-list-before-signalling-ScanDone-b.patch 2015-09-17 21:39:20 +0000 |
4164 | +++ debian/patches/0002-wifi-cull-the-scan-list-before-signalling-ScanDone-b.patch 1970-01-01 00:00:00 +0000 |
4165 | @@ -1,171 +0,0 @@ |
4166 | -From ae6df9e3a98f67c8965d6e62e16abfc3d2550f90 Mon Sep 17 00:00:00 2001 |
4167 | -From: Thomas Voss <thomas.voss@canonical.com> |
4168 | -Date: Tue, 11 Nov 2014 12:04:42 -0500 |
4169 | -Subject: [PATCH 2/2] wifi: cull the scan list before signalling ScanDone (bug |
4170 | - 737414) |
4171 | - |
4172 | -The scan list should get cleaned up at the end of the scan, but before |
4173 | -signalling that the scan is done (and before scheduling a new scan), so |
4174 | -that when SCAN_DONE is received by applications, the scan list properly |
4175 | -reflects the result of the scan, and don't retain some old APs. |
4176 | - |
4177 | -Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
4178 | ---- |
4179 | - src/devices/wifi/nm-device-wifi.c | 35 +++++++++++++++++++++++++++++------ |
4180 | - 1 file changed, 29 insertions(+), 6 deletions(-) |
4181 | - |
4182 | -Index: network-manager-1.0.4/src/devices/wifi/nm-device-wifi.c |
4183 | -=================================================================== |
4184 | ---- network-manager-1.0.4.orig/src/devices/wifi/nm-device-wifi.c |
4185 | -+++ network-manager-1.0.4/src/devices/wifi/nm-device-wifi.c |
4186 | -@@ -123,7 +123,6 @@ struct _NMDeviceWifiPrivate { |
4187 | - gint32 scheduled_scan_time; |
4188 | - guint8 scan_interval; /* seconds */ |
4189 | - guint pending_scan_id; |
4190 | -- guint scanlist_cull_id; |
4191 | - gboolean requested_scan; |
4192 | - |
4193 | - NMSupplicantManager *sup_mgr; |
4194 | -@@ -160,11 +159,6 @@ static void supplicant_iface_new_bss_cb |
4195 | - GVariant *properties, |
4196 | - NMDeviceWifi * self); |
4197 | - |
4198 | --static void supplicant_iface_bss_updated_cb (NMSupplicantInterface *iface, |
4199 | -- const char *object_path, |
4200 | -- GHashTable *properties, |
4201 | -- NMDeviceWifi *self); |
4202 | -- |
4203 | - static void supplicant_iface_bss_removed_cb (NMSupplicantInterface *iface, |
4204 | - const char *object_path, |
4205 | - NMDeviceWifi *self); |
4206 | -@@ -177,7 +171,7 @@ static void supplicant_iface_notify_scan |
4207 | - GParamSpec * pspec, |
4208 | - NMDeviceWifi * self); |
4209 | - |
4210 | --static void schedule_scanlist_cull (NMDeviceWifi *self); |
4211 | -+static gboolean cull_scan_list(NMDeviceWifi *self); |
4212 | - |
4213 | - static gboolean request_wireless_scan (gpointer user_data); |
4214 | - |
4215 | -@@ -252,10 +246,6 @@ supplicant_interface_acquire (NMDeviceWi |
4216 | - G_CALLBACK (supplicant_iface_new_bss_cb), |
4217 | - self); |
4218 | - g_signal_connect (priv->sup_iface, |
4219 | -- NM_SUPPLICANT_INTERFACE_BSS_UPDATED, |
4220 | -- G_CALLBACK (supplicant_iface_bss_updated_cb), |
4221 | -- self); |
4222 | -- g_signal_connect (priv->sup_iface, |
4223 | - NM_SUPPLICANT_INTERFACE_BSS_REMOVED, |
4224 | - G_CALLBACK (supplicant_iface_bss_removed_cb), |
4225 | - self); |
4226 | -@@ -287,11 +277,6 @@ supplicant_interface_release (NMDeviceWi |
4227 | - _LOGD (LOGD_WIFI_SCAN, "reset scanning interval to %d seconds", |
4228 | - priv->scan_interval); |
4229 | - |
4230 | -- if (priv->scanlist_cull_id) { |
4231 | -- g_source_remove (priv->scanlist_cull_id); |
4232 | -- priv->scanlist_cull_id = 0; |
4233 | -- } |
4234 | -- |
4235 | - if (priv->sup_iface) { |
4236 | - remove_supplicant_interface_error_handler (self); |
4237 | - |
4238 | -@@ -1607,14 +1592,17 @@ supplicant_iface_scan_done_cb (NMSupplic |
4239 | - |
4240 | - _LOGD (LOGD_WIFI_SCAN, "scan %s", success ? "successful" : "failed"); |
4241 | - |
4242 | -- g_signal_emit (self, signals[SCAN_DONE], 0, NULL); |
4243 | -- |
4244 | -- schedule_scan (self, success); |
4245 | -- |
4246 | - /* Ensure that old APs get removed, which otherwise only |
4247 | - * happens when there are new BSSes. |
4248 | - */ |
4249 | -- schedule_scanlist_cull (self); |
4250 | -+ cull_scan_list (self); |
4251 | -+ |
4252 | -+ /* And let listeners know that a scan is done, with |
4253 | -+ * all last-seen timestamps being updated. |
4254 | -+ */ |
4255 | -+ g_signal_emit (self, signals[SCAN_DONE], 0, NULL); |
4256 | -+ |
4257 | -+ schedule_scan (self, success); |
4258 | - |
4259 | - if (priv->requested_scan) { |
4260 | - priv->requested_scan = FALSE; |
4261 | -@@ -1761,8 +1749,6 @@ cull_scan_list (NMDeviceWifi *self) |
4262 | - GSList *elt; |
4263 | - guint32 removed = 0, total = 0; |
4264 | - |
4265 | -- priv->scanlist_cull_id = 0; |
4266 | -- |
4267 | - _LOGD (LOGD_WIFI_SCAN, "checking scan list for outdated APs"); |
4268 | - |
4269 | - /* Walk the access point list and remove any access points older than |
4270 | -@@ -1786,8 +1772,10 @@ cull_scan_list (NMDeviceWifi *self) |
4271 | - * supplicant in the last scan. |
4272 | - */ |
4273 | - if ( nm_ap_get_supplicant_path (ap) |
4274 | -- && g_object_get_data (G_OBJECT (ap), WPAS_REMOVED_TAG) == NULL) |
4275 | -+ && g_object_get_data (G_OBJECT (ap), WPAS_REMOVED_TAG) == NULL) { |
4276 | -+ nm_ap_update_last_seen (ap); |
4277 | - continue; |
4278 | -+ } |
4279 | - |
4280 | - last_seen = nm_ap_get_last_seen (ap); |
4281 | - if (!last_seen || last_seen + prune_interval_s < boottime_now) |
4282 | -@@ -1824,17 +1812,6 @@ cull_scan_list (NMDeviceWifi *self) |
4283 | - } |
4284 | - |
4285 | - static void |
4286 | --schedule_scanlist_cull (NMDeviceWifi *self) |
4287 | --{ |
4288 | -- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); |
4289 | -- |
4290 | -- /* Cull the scan list after the last request for it has come in */ |
4291 | -- if (priv->scanlist_cull_id) |
4292 | -- g_source_remove (priv->scanlist_cull_id); |
4293 | -- priv->scanlist_cull_id = g_timeout_add_seconds (4, (GSourceFunc) cull_scan_list, self); |
4294 | --} |
4295 | -- |
4296 | --static void |
4297 | - supplicant_iface_new_bss_cb (NMSupplicantInterface *iface, |
4298 | - const char *object_path, |
4299 | - GVariant *properties, |
4300 | -@@ -1863,36 +1840,6 @@ supplicant_iface_new_bss_cb (NMSupplican |
4301 | - g_object_unref (ap); |
4302 | - } else |
4303 | - _LOGW (LOGD_WIFI_SCAN, "invalid AP properties received"); |
4304 | -- |
4305 | -- /* Remove outdated access points */ |
4306 | -- schedule_scanlist_cull (self); |
4307 | --} |
4308 | -- |
4309 | --static void |
4310 | --supplicant_iface_bss_updated_cb (NMSupplicantInterface *iface, |
4311 | -- const char *object_path, |
4312 | -- GHashTable *properties, |
4313 | -- NMDeviceWifi *self) |
4314 | --{ |
4315 | -- NMDeviceState state; |
4316 | -- NMAccessPoint *ap; |
4317 | -- |
4318 | -- g_return_if_fail (self != NULL); |
4319 | -- g_return_if_fail (object_path != NULL); |
4320 | -- g_return_if_fail (properties != NULL); |
4321 | -- |
4322 | -- /* Ignore new APs when unavailable or unamnaged */ |
4323 | -- state = nm_device_get_state (NM_DEVICE (self)); |
4324 | -- if (state <= NM_DEVICE_STATE_UNAVAILABLE) |
4325 | -- return; |
4326 | -- |
4327 | -- /* Update the AP's last-seen property */ |
4328 | -- ap = get_ap_by_supplicant_path (self, object_path); |
4329 | -- if (ap) |
4330 | -- nm_ap_update_last_seen (ap); |
4331 | -- |
4332 | -- /* Remove outdated access points */ |
4333 | -- schedule_scanlist_cull (self); |
4334 | - } |
4335 | - |
4336 | - static void |
4337 | |
4338 | === removed file 'debian/patches/0002-wifi-expose-the-last_seen-property-for-a-NMAccessPoi.patch' |
4339 | --- debian/patches/0002-wifi-expose-the-last_seen-property-for-a-NMAccessPoi.patch 2015-08-20 01:07:00 +0000 |
4340 | +++ debian/patches/0002-wifi-expose-the-last_seen-property-for-a-NMAccessPoi.patch 1970-01-01 00:00:00 +0000 |
4341 | @@ -1,337 +0,0 @@ |
4342 | -From 3c9a463eef6ed777734461e2a98c6d8e620acb39 Mon Sep 17 00:00:00 2001 |
4343 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
4344 | -Date: Tue, 11 Nov 2014 12:37:04 -0500 |
4345 | -Subject: [PATCH 2/2] wifi: expose the last_seen property for a NMAccessPoint |
4346 | - over DBus |
4347 | - |
4348 | -Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
4349 | ---- |
4350 | - introspection/nm-access-point.xml | 3 ++ |
4351 | - libnm-glib/libnm-glib.ver | 1 |
4352 | - libnm-glib/nm-access-point.c | 36 +++++++++++++++++++++++++ |
4353 | - libnm-glib/nm-access-point.h | 2 + |
4354 | - src/devices/wifi/nm-device-wifi.c | 8 +++-- |
4355 | - src/devices/wifi/nm-wifi-ap.c | 53 ++++++++++++++++++++++++++++++++------ |
4356 | - src/devices/wifi/nm-wifi-ap.h | 6 ++-- |
4357 | - 7 files changed, 97 insertions(+), 12 deletions(-) |
4358 | - |
4359 | -Index: b/introspection/nm-access-point.xml |
4360 | -=================================================================== |
4361 | ---- a/introspection/nm-access-point.xml |
4362 | -+++ b/introspection/nm-access-point.xml |
4363 | -@@ -30,6 +30,9 @@ |
4364 | - <property name="Strength" type="y" access="read"> |
4365 | - <tp:docstring>The current signal quality of the access point, in percent.</tp:docstring> |
4366 | - </property> |
4367 | -+ <property name="LastSeen" type="u" access="read"> |
4368 | -+ <tp:docstring>The timestamp for the last time the access point was found in scan results.</tp:docstring> |
4369 | -+ </property> |
4370 | - |
4371 | - <signal name="PropertiesChanged"> |
4372 | - <arg name="properties" type="a{sv}" tp:type="String_Variant_Map"> |
4373 | -Index: b/libnm-glib/libnm-glib.ver |
4374 | -=================================================================== |
4375 | ---- a/libnm-glib/libnm-glib.ver |
4376 | -+++ b/libnm-glib/libnm-glib.ver |
4377 | -@@ -11,6 +11,7 @@ global: |
4378 | - nm_access_point_get_flags; |
4379 | - nm_access_point_get_frequency; |
4380 | - nm_access_point_get_hw_address; |
4381 | -+ nm_access_point_get_last_seen; |
4382 | - nm_access_point_get_max_bitrate; |
4383 | - nm_access_point_get_mode; |
4384 | - nm_access_point_get_rsn_flags; |
4385 | -Index: b/libnm-glib/nm-access-point.c |
4386 | -=================================================================== |
4387 | ---- a/libnm-glib/nm-access-point.c |
4388 | -+++ b/libnm-glib/nm-access-point.c |
4389 | -@@ -53,6 +53,7 @@ typedef struct { |
4390 | - NM80211Mode mode; |
4391 | - guint32 max_bitrate; |
4392 | - guint8 strength; |
4393 | -+ guint32 last_seen; |
4394 | - } NMAccessPointPrivate; |
4395 | - |
4396 | - enum { |
4397 | -@@ -67,6 +68,7 @@ enum { |
4398 | - PROP_MAX_BITRATE, |
4399 | - PROP_STRENGTH, |
4400 | - PROP_BSSID, |
4401 | -+ PROP_LAST_SEEN, |
4402 | - |
4403 | - LAST_PROP |
4404 | - }; |
4405 | -@@ -266,6 +268,23 @@ nm_access_point_get_strength (NMAccessPo |
4406 | - } |
4407 | - |
4408 | - /** |
4409 | -+ * nm_access_point_get_last_seen: |
4410 | -+ * @ap: a #NMAccessPoint |
4411 | -+ * |
4412 | -+ * Gets the last seen timestamp for the access point. |
4413 | -+ * |
4414 | -+ * Returns: the last seen time in seconds |
4415 | -+ **/ |
4416 | -+guint32 |
4417 | -+nm_access_point_get_last_seen (NMAccessPoint *ap) |
4418 | -+{ |
4419 | -+ g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0); |
4420 | -+ |
4421 | -+ _nm_object_ensure_inited (NM_OBJECT (ap)); |
4422 | -+ return NM_ACCESS_POINT_GET_PRIVATE (ap)->last_seen; |
4423 | -+} |
4424 | -+ |
4425 | -+/** |
4426 | - * nm_access_point_connection_valid: |
4427 | - * @ap: an #NMAccessPoint to validate @connection against |
4428 | - * @connection: an #NMConnection to validate against @ap |
4429 | -@@ -482,6 +501,9 @@ get_property (GObject *object, |
4430 | - case PROP_STRENGTH: |
4431 | - g_value_set_uchar (value, nm_access_point_get_strength (ap)); |
4432 | - break; |
4433 | -+ case PROP_LAST_SEEN: |
4434 | -+ g_value_set_uint (value, nm_access_point_get_last_seen (ap)); |
4435 | -+ break; |
4436 | - default: |
4437 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
4438 | - break; |
4439 | -@@ -512,6 +534,7 @@ register_properties (NMAccessPoint *ap) |
4440 | - { NM_ACCESS_POINT_MODE, &priv->mode }, |
4441 | - { NM_ACCESS_POINT_MAX_BITRATE, &priv->max_bitrate }, |
4442 | - { NM_ACCESS_POINT_STRENGTH, &priv->strength }, |
4443 | -+ { NM_ACCESS_POINT_LAST_SEEN, &priv->last_seen }, |
4444 | - { NULL }, |
4445 | - }; |
4446 | - |
4447 | -@@ -671,4 +694,17 @@ nm_access_point_class_init (NMAccessPoin |
4448 | - 0, G_MAXUINT8, 0, |
4449 | - G_PARAM_READABLE | |
4450 | - G_PARAM_STATIC_STRINGS)); |
4451 | -+ |
4452 | -+ /** |
4453 | -+ * NMAccessPoint:last-seen: |
4454 | -+ * |
4455 | -+ * The last seen timestamp of the access point. |
4456 | -+ **/ |
4457 | -+ g_object_class_install_property |
4458 | -+ (object_class, PROP_LAST_SEEN, |
4459 | -+ g_param_spec_uint (NM_ACCESS_POINT_LAST_SEEN, |
4460 | -+ "Last Seen", |
4461 | -+ "Last Seen", |
4462 | -+ 0, G_MAXUINT32, 0, |
4463 | -+ G_PARAM_READABLE)); |
4464 | - } |
4465 | -Index: b/libnm-glib/nm-access-point.h |
4466 | -=================================================================== |
4467 | ---- a/libnm-glib/nm-access-point.h |
4468 | -+++ b/libnm-glib/nm-access-point.h |
4469 | -@@ -46,6 +46,7 @@ G_BEGIN_DECLS |
4470 | - #define NM_ACCESS_POINT_MODE "mode" |
4471 | - #define NM_ACCESS_POINT_MAX_BITRATE "max-bitrate" |
4472 | - #define NM_ACCESS_POINT_STRENGTH "strength" |
4473 | -+#define NM_ACCESS_POINT_LAST_SEEN "last-seen" |
4474 | - |
4475 | - /* DEPRECATED */ |
4476 | - #define NM_ACCESS_POINT_HW_ADDRESS "hw-address" |
4477 | -@@ -80,6 +81,7 @@ guint32 nm_access_point_g |
4478 | - NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap); |
4479 | - guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap); |
4480 | - guint8 nm_access_point_get_strength (NMAccessPoint *ap); |
4481 | -+guint32 nm_access_point_get_last_seen (NMAccessPoint *ap); |
4482 | - |
4483 | - GSList * nm_access_point_filter_connections (NMAccessPoint *ap, |
4484 | - const GSList *connections); |
4485 | -Index: b/src/devices/wifi/nm-device-wifi.c |
4486 | -=================================================================== |
4487 | ---- a/src/devices/wifi/nm-device-wifi.c |
4488 | -+++ b/src/devices/wifi/nm-device-wifi.c |
4489 | -@@ -1752,6 +1752,8 @@ cull_scan_list (NMDeviceWifi *self) |
4490 | - { |
4491 | - NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); |
4492 | - gint32 now = nm_utils_get_monotonic_timestamp_s (); |
4493 | -+ guint32 boottime_now = nm_utils_monotonic_timestamp_as_boottime (now, |
4494 | -+ NM_UTILS_NS_PER_SECOND); |
4495 | - GSList *outdated_list = NULL; |
4496 | - GSList *elt; |
4497 | - guint32 removed = 0, total = 0; |
4498 | -@@ -1766,7 +1768,7 @@ cull_scan_list (NMDeviceWifi *self) |
4499 | - for (elt = priv->ap_list; elt; elt = g_slist_next (elt), total++) { |
4500 | - NMAccessPoint *ap = elt->data; |
4501 | - const guint prune_interval_s = SCAN_INTERVAL_MAX * 3; |
4502 | -- gint32 last_seen; |
4503 | -+ guint32 last_seen; |
4504 | - |
4505 | - /* Don't cull the associated AP or manually created APs */ |
4506 | - if (ap == priv->current_ap) |
4507 | -@@ -1785,7 +1787,7 @@ cull_scan_list (NMDeviceWifi *self) |
4508 | - continue; |
4509 | - |
4510 | - last_seen = nm_ap_get_last_seen (ap); |
4511 | -- if (!last_seen || last_seen + prune_interval_s < now) |
4512 | -+ if (!last_seen || last_seen + prune_interval_s < boottime_now) |
4513 | - outdated_list = g_slist_prepend (outdated_list, ap); |
4514 | - } |
4515 | - |
4516 | -@@ -1884,7 +1886,7 @@ supplicant_iface_bss_updated_cb (NMSuppl |
4517 | - /* Update the AP's last-seen property */ |
4518 | - ap = get_ap_by_supplicant_path (self, object_path); |
4519 | - if (ap) |
4520 | -- nm_ap_set_last_seen (ap, nm_utils_get_monotonic_timestamp_s ()); |
4521 | -+ nm_ap_update_last_seen (ap); |
4522 | - |
4523 | - /* Remove outdated access points */ |
4524 | - schedule_scanlist_cull (self); |
4525 | -Index: b/src/devices/wifi/nm-wifi-ap.c |
4526 | -=================================================================== |
4527 | ---- a/src/devices/wifi/nm-wifi-ap.c |
4528 | -+++ b/src/devices/wifi/nm-wifi-ap.c |
4529 | -@@ -61,7 +61,7 @@ typedef struct |
4530 | - gboolean fake; /* Whether or not the AP is from a scan */ |
4531 | - gboolean hotspot; /* Whether the AP is a local device's hotspot network */ |
4532 | - gboolean broadcast; /* Whether or not the AP is broadcasting (hidden) */ |
4533 | -- gint32 last_seen; /* Timestamp when the AP was seen lastly (obtained via nm_utils_get_monotonic_timestamp_s()) */ |
4534 | -+ guint32 last_seen; /* Timestamp when the AP was seen lastly (obtained via nm_utils_get_monotonic_timestamp_s()) */ |
4535 | - } NMAccessPointPrivate; |
4536 | - |
4537 | - #define NM_AP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_AP, NMAccessPointPrivate)) |
4538 | -@@ -79,6 +79,7 @@ enum { |
4539 | - PROP_MODE, |
4540 | - PROP_MAX_BITRATE, |
4541 | - PROP_STRENGTH, |
4542 | -+ PROP_LAST_SEEN, |
4543 | - LAST_PROP |
4544 | - }; |
4545 | - |
4546 | -@@ -92,6 +93,7 @@ nm_ap_init (NMAccessPoint *ap) |
4547 | - priv->flags = NM_802_11_AP_FLAGS_NONE; |
4548 | - priv->wpa_flags = NM_802_11_AP_SEC_NONE; |
4549 | - priv->rsn_flags = NM_802_11_AP_SEC_NONE; |
4550 | -+ priv->last_seen = 0; |
4551 | - priv->broadcast = TRUE; |
4552 | - } |
4553 | - |
4554 | -@@ -147,6 +149,9 @@ set_property (GObject *object, guint pro |
4555 | - break; |
4556 | - case PROP_HW_ADDRESS: |
4557 | - break; |
4558 | -+ case PROP_LAST_SEEN: |
4559 | -+ nm_ap_set_last_seen (ap, g_value_get_uint (value)); |
4560 | -+ break; |
4561 | - default: |
4562 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
4563 | - break; |
4564 | -@@ -195,6 +200,9 @@ get_property (GObject *object, guint pro |
4565 | - case PROP_STRENGTH: |
4566 | - g_value_set_schar (value, priv->strength); |
4567 | - break; |
4568 | -+ case PROP_LAST_SEEN: |
4569 | -+ g_value_set_uint (value, priv->last_seen); |
4570 | -+ break; |
4571 | - default: |
4572 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
4573 | - break; |
4574 | -@@ -294,6 +302,14 @@ nm_ap_class_init (NMAccessPointClass *ap |
4575 | - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | |
4576 | - G_PARAM_STATIC_STRINGS)); |
4577 | - |
4578 | -+ g_object_class_install_property |
4579 | -+ (object_class, PROP_LAST_SEEN, |
4580 | -+ g_param_spec_uint (NM_AP_LAST_SEEN, |
4581 | -+ "Last Seen", |
4582 | -+ "Last Seen", |
4583 | -+ 0, G_MAXUINT32, 0, |
4584 | -+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); |
4585 | -+ |
4586 | - nm_dbus_manager_register_exported_type (nm_dbus_manager_get (), |
4587 | - G_TYPE_FROM_CLASS (ap_class), |
4588 | - &dbus_glib_nm_access_point_object_info); |
4589 | -@@ -470,7 +486,7 @@ nm_ap_new_from_properties (const char *s |
4590 | - return NULL; |
4591 | - } |
4592 | - |
4593 | -- nm_ap_set_last_seen (ap, nm_utils_get_monotonic_timestamp_s ()); |
4594 | -+ nm_ap_update_last_seen (ap); |
4595 | - |
4596 | - if (!nm_ap_get_ssid (ap)) |
4597 | - nm_ap_set_broadcast (ap, FALSE); |
4598 | -@@ -707,7 +723,7 @@ nm_ap_dump (NMAccessPoint *ap, const cha |
4599 | - nm_log_dbg (LOGD_WIFI_SCAN, " quality %d", priv->strength); |
4600 | - nm_log_dbg (LOGD_WIFI_SCAN, " frequency %d", priv->freq); |
4601 | - nm_log_dbg (LOGD_WIFI_SCAN, " max rate %d", priv->max_bitrate); |
4602 | -- nm_log_dbg (LOGD_WIFI_SCAN, " last-seen %d", (int) priv->last_seen); |
4603 | -+ nm_log_dbg (LOGD_WIFI_SCAN, " last-seen %d", priv->last_seen); |
4604 | - } |
4605 | - |
4606 | - const char * |
4607 | -@@ -1053,20 +1069,43 @@ void nm_ap_set_broadcast (NMAccessPoint |
4608 | - * APs older than a certain date are dropped from the list. |
4609 | - * |
4610 | - */ |
4611 | --gint32 |
4612 | -+guint32 |
4613 | - nm_ap_get_last_seen (const NMAccessPoint *ap) |
4614 | - { |
4615 | -- g_return_val_if_fail (NM_IS_AP (ap), FALSE); |
4616 | -+ g_return_val_if_fail (NM_IS_AP (ap), 0); |
4617 | - |
4618 | - return NM_AP_GET_PRIVATE (ap)->last_seen; |
4619 | - } |
4620 | - |
4621 | - void |
4622 | --nm_ap_set_last_seen (NMAccessPoint *ap, gint32 last_seen) |
4623 | -+nm_ap_set_last_seen (NMAccessPoint *ap, guint32 last_seen) |
4624 | -+{ |
4625 | -+ NMAccessPointPrivate *priv; |
4626 | -+ |
4627 | -+ g_return_if_fail (NM_IS_AP (ap)); |
4628 | -+ |
4629 | -+ priv = NM_AP_GET_PRIVATE (ap); |
4630 | -+ |
4631 | -+ if (priv->last_seen != last_seen) { |
4632 | -+ priv->last_seen = last_seen; |
4633 | -+ g_object_notify (G_OBJECT (ap), NM_AP_LAST_SEEN); |
4634 | -+ } |
4635 | -+} |
4636 | -+ |
4637 | -+void |
4638 | -+nm_ap_update_last_seen (NMAccessPoint *ap) |
4639 | - { |
4640 | -+ gint64 timestamp; |
4641 | -+ |
4642 | - g_return_if_fail (NM_IS_AP (ap)); |
4643 | - |
4644 | -- NM_AP_GET_PRIVATE (ap)->last_seen = last_seen; |
4645 | -+ timestamp = nm_utils_get_monotonic_timestamp_s(); |
4646 | -+ timestamp = nm_utils_monotonic_timestamp_as_boottime (timestamp, |
4647 | -+ NM_UTILS_NS_PER_SECOND); |
4648 | -+ g_return_if_fail (timestamp >= 0); |
4649 | -+ g_return_if_fail (timestamp <= G_MAXUINT32); |
4650 | -+ |
4651 | -+ nm_ap_set_last_seen (ap, (guint32) timestamp); |
4652 | - } |
4653 | - |
4654 | - gboolean |
4655 | -Index: b/src/devices/wifi/nm-wifi-ap.h |
4656 | -=================================================================== |
4657 | ---- a/src/devices/wifi/nm-wifi-ap.h |
4658 | -+++ b/src/devices/wifi/nm-wifi-ap.h |
4659 | -@@ -43,6 +43,7 @@ |
4660 | - #define NM_AP_MODE "mode" |
4661 | - #define NM_AP_MAX_BITRATE "max-bitrate" |
4662 | - #define NM_AP_STRENGTH "strength" |
4663 | -+#define NM_AP_LAST_SEEN "last-seen" |
4664 | - |
4665 | - typedef struct { |
4666 | - GObject parent; |
4667 | -@@ -101,8 +102,9 @@ void nm_ap_set_fake (NMAccessPoint * |
4668 | - gboolean nm_ap_get_broadcast (NMAccessPoint *ap); |
4669 | - void nm_ap_set_broadcast (NMAccessPoint *ap, gboolean broadcast); |
4670 | - |
4671 | --gint32 nm_ap_get_last_seen (const NMAccessPoint *ap); |
4672 | --void nm_ap_set_last_seen (NMAccessPoint *ap, gint32 last_seen); |
4673 | -+guint32 nm_ap_get_last_seen (const NMAccessPoint *ap); |
4674 | -+void nm_ap_set_last_seen (NMAccessPoint *ap, guint32 last_seen); |
4675 | -+void nm_ap_update_last_seen (NMAccessPoint *ap); |
4676 | - |
4677 | - gboolean nm_ap_check_compatible (NMAccessPoint *self, |
4678 | - NMConnection *connection); |
4679 | |
4680 | === removed file 'debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch' |
4681 | --- debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch 2015-08-20 01:07:00 +0000 |
4682 | +++ debian/patches/0003-Don-t-setup-Sleep-Monitor-if-not-booted-with-systemd.patch 1970-01-01 00:00:00 +0000 |
4683 | @@ -1,61 +0,0 @@ |
4684 | -From: Michael Biebl <biebl@debian.org> |
4685 | -Date: Sat, 12 Apr 2014 12:38:09 +0200 |
4686 | -Subject: Don't setup Sleep Monitor if not booted with systemd |
4687 | - |
4688 | -NetworkManager uses systemd for suspend/resume support. It listens for |
4689 | -the PrepareForSleep and Resume D-Bus signal sent by logind/systemd and |
4690 | -deactivates the interfaces on sleep and reactivates them on resume. |
4691 | -With a standalone logind we don't get a Resume signal and |
4692 | -NetworkManager remains in sleep mode where the devices are unmanaged. |
4693 | -As a workaround, skip the Sleep Monitor setup if not booted with |
4694 | -systemd. |
4695 | - |
4696 | -Closes: #742933 |
4697 | ---- |
4698 | - src/Makefile.am | 2 ++ |
4699 | - src/nm-sleep-monitor-systemd.c | 5 +++++ |
4700 | - 2 files changed, 7 insertions(+) |
4701 | - |
4702 | -Index: b/src/Makefile.am |
4703 | -=================================================================== |
4704 | ---- a/src/Makefile.am |
4705 | -+++ b/src/Makefile.am |
4706 | -@@ -422,6 +422,7 @@ AM_CPPFLAGS += \ |
4707 | - $(LIBSOUP_CFLAGS) \ |
4708 | - $(SYSTEMD_LOGIN_CFLAGS) \ |
4709 | - $(SYSTEMD_DHCP_CFLAGS) \ |
4710 | -+ $(SYSTEMD_INHIBIT_CFLAGS) \ |
4711 | - \ |
4712 | - -DBINDIR=\"$(bindir)\" \ |
4713 | - -DDATADIR=\"$(datadir)\" \ |
4714 | -@@ -459,6 +460,7 @@ libNetworkManager_la_LIBADD = \ |
4715 | - $(GUDEV_LIBS) \ |
4716 | - $(LIBNL_LIBS) \ |
4717 | - $(SYSTEMD_LOGIN_LIBS) \ |
4718 | -+ $(SYSTEMD_INHIBIT_LIBS) \ |
4719 | - $(LIBNDP_LIBS) \ |
4720 | - $(LIBDL) \ |
4721 | - $(LIBM) |
4722 | -Index: b/src/nm-sleep-monitor-systemd.c |
4723 | -=================================================================== |
4724 | ---- a/src/nm-sleep-monitor-systemd.c |
4725 | -+++ b/src/nm-sleep-monitor-systemd.c |
4726 | -@@ -25,6 +25,7 @@ |
4727 | - #include <glib/gi18n.h> |
4728 | - #include <gio/gio.h> |
4729 | - #include <gio/gunixfdlist.h> |
4730 | -+#include <systemd/sd-daemon.h> |
4731 | - |
4732 | - #include "nm-logging.h" |
4733 | - #include "nm-dbus-manager.h" |
4734 | -@@ -193,6 +194,10 @@ on_proxy_acquired (GObject *object, |
4735 | - static void |
4736 | - nm_sleep_monitor_init (NMSleepMonitor *self) |
4737 | - { |
4738 | -+ if (!sd_booted()) { |
4739 | -+ nm_log_warn (LOGD_SUSPEND, "Skipping Sleep Monitor setup, system not booted with systemd"); |
4740 | -+ return; |
4741 | -+ } |
4742 | - self->inhibit_fd = -1; |
4743 | - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, |
4744 | - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | |
4745 | |
4746 | === removed file 'debian/patches/0003-cli-add-support-for-wifi.powersave-setting.patch' |
4747 | --- debian/patches/0003-cli-add-support-for-wifi.powersave-setting.patch 2015-08-20 01:07:00 +0000 |
4748 | +++ debian/patches/0003-cli-add-support-for-wifi.powersave-setting.patch 1970-01-01 00:00:00 +0000 |
4749 | @@ -1,89 +0,0 @@ |
4750 | -From 6d45410be3b4b7b01905046e1ba5115d86ba797a Mon Sep 17 00:00:00 2001 |
4751 | -From: Dan Williams <dcbw@redhat.com> |
4752 | -Date: Mon, 17 Nov 2014 09:18:08 -0600 |
4753 | -Subject: [PATCH 3/5] cli: add support for wifi.powersave setting |
4754 | - |
4755 | ---- |
4756 | - clients/cli/settings.c | 41 ++++++++++++++++++++++++++++++++++++++++- |
4757 | - 1 file changed, 40 insertions(+), 1 deletion(-) |
4758 | - |
4759 | -Index: b/clients/cli/settings.c |
4760 | -=================================================================== |
4761 | ---- a/clients/cli/settings.c |
4762 | -+++ b/clients/cli/settings.c |
4763 | -@@ -198,6 +198,7 @@ NmcOutputField nmc_fields_setting_wirele |
4764 | - SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 11 */ |
4765 | - SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 12 */ |
4766 | - SETTING_FIELD (NM_SETTING_WIRELESS_HIDDEN, 10), /* 13 */ |
4767 | -+ SETTING_FIELD (NM_SETTING_WIRELESS_POWERSAVE, 10), /* 14 */ |
4768 | - {NULL, NULL, 0, NULL, FALSE, FALSE, 0} |
4769 | - }; |
4770 | - #define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ |
4771 | -@@ -213,7 +214,8 @@ NmcOutputField nmc_fields_setting_wirele |
4772 | - NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST","\ |
4773 | - NM_SETTING_WIRELESS_MTU","\ |
4774 | - NM_SETTING_WIRELESS_SEEN_BSSIDS","\ |
4775 | -- NM_SETTING_WIRELESS_HIDDEN |
4776 | -+ NM_SETTING_WIRELESS_HIDDEN"," \ |
4777 | -+ NM_SETTING_WIRELESS_POWERSAVE |
4778 | - #define NMC_FIELDS_SETTING_WIRELESS_COMMON NMC_FIELDS_SETTING_WIRELESS_ALL |
4779 | - |
4780 | - /* Available fields for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ |
4781 | -@@ -1553,6 +1555,15 @@ nmc_property_wireless_get_mtu (NMSetting |
4782 | - return g_strdup_printf ("%d", mtu); |
4783 | - } |
4784 | - |
4785 | -+static char * |
4786 | -+nmc_property_wifi_get_powersave (NMSetting *setting) |
4787 | -+{ |
4788 | -+ NMSettingWireless *s_wireless = NM_SETTING_WIRELESS (setting); |
4789 | -+ |
4790 | -+ return nm_setting_wireless_get_powersave (s_wireless) ? |
4791 | -+ g_strdup (_("yes")) : g_strdup (_("no")); |
4792 | -+} |
4793 | -+ |
4794 | - /* --- NM_SETTING_WIRELESS_SECURITY_SETTING_NAME property get functions --- */ |
4795 | - DEFINE_GETTER (nmc_property_wifi_sec_get_key_mgmt, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT) |
4796 | - DEFINE_GETTER (nmc_property_wifi_sec_get_wep_tx_keyidx, NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX) |
4797 | -@@ -4195,6 +4206,27 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_prope |
4798 | - nm_setting_wireless_remove_mac_blacklist_item, |
4799 | - _validate_and_remove_wifi_mac_blacklist_item) |
4800 | - |
4801 | -+/* 'powersave' */ |
4802 | -+static gboolean |
4803 | -+nmc_property_wifi_set_powersave (NMSetting *setting, const char *prop, const char *val, GError **error) |
4804 | -+{ |
4805 | -+ unsigned long powersave_int; |
4806 | -+ gboolean val_bool = FALSE; |
4807 | -+ |
4808 | -+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE); |
4809 | -+ |
4810 | -+ if (!nmc_string_to_uint (val, TRUE, 0, G_MAXUINT32, &powersave_int)) { |
4811 | -+ if (!nmc_string_to_bool (val, &val_bool, NULL)) { |
4812 | -+ g_set_error (error, 1, 0, _("'%s' is not a valid powersave value"), val); |
4813 | -+ return FALSE; |
4814 | -+ } |
4815 | -+ powersave_int = val_bool ? 1 : 0; |
4816 | -+ } |
4817 | -+ |
4818 | -+ g_object_set (setting, prop, (guint32) powersave_int, NULL); |
4819 | -+ return TRUE; |
4820 | -+} |
4821 | -+ |
4822 | - /* --- NM_SETTING_WIRELESS_SECURITY_SETTING_NAME property setter functions --- */ |
4823 | - /* 'key-mgmt' */ |
4824 | - static const char *wifi_sec_valid_key_mgmts[] = { "none", "ieee8021x", "wpa-none", "wpa-psk", "wpa-eap", NULL }; |
4825 | -@@ -6174,6 +6206,13 @@ nmc_properties_init (void) |
4826 | - NULL, |
4827 | - NULL, |
4828 | - NULL, |
4829 | -+ NULL); |
4830 | -+ nmc_add_prop_funcs (GLUE (WIRELESS, POWERSAVE), |
4831 | -+ nmc_property_wifi_get_powersave, |
4832 | -+ nmc_property_wifi_set_powersave, |
4833 | -+ NULL, |
4834 | -+ NULL, |
4835 | -+ NULL, |
4836 | - NULL); |
4837 | - |
4838 | - /* Add editable properties for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ |
4839 | |
4840 | === removed file 'debian/patches/0004-Use-symlinks-for-nmtui.patch' |
4841 | --- debian/patches/0004-Use-symlinks-for-nmtui.patch 2015-08-20 01:07:00 +0000 |
4842 | +++ debian/patches/0004-Use-symlinks-for-nmtui.patch 1970-01-01 00:00:00 +0000 |
4843 | @@ -1,35 +0,0 @@ |
4844 | -From: Michael Biebl <biebl@debian.org> |
4845 | -Date: Thu, 10 Jul 2014 03:33:18 +0200 |
4846 | -Subject: Use symlinks for nmtui |
4847 | - |
4848 | -Make /usr/bin/nmtui-* symbolic links to /usr/bin/nmtui. |
4849 | ---- |
4850 | - configure.ac | 2 ++ |
4851 | - 1 file changed, 2 insertions(+) |
4852 | - |
4853 | -Index: b/configure.ac |
4854 | -=================================================================== |
4855 | ---- a/configure.ac |
4856 | -+++ b/configure.ac |
4857 | -@@ -33,6 +33,8 @@ AM_PROG_CC_C_O |
4858 | - # C++ only required if --enable-qt=yes |
4859 | - AC_PROG_CXX |
4860 | - |
4861 | -+AC_PROG_LN_S |
4862 | -+ |
4863 | - dnl Initialize libtool |
4864 | - LT_PREREQ([2.2]) |
4865 | - LT_INIT([disable-static]) |
4866 | -diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am |
4867 | -index ad9335d..09f2700 100644 |
4868 | ---- a/clients/tui/Makefile.am |
4869 | -+++ b/clients/tui/Makefile.am |
4870 | -@@ -24,7 +24,7 @@ links = nmtui-edit nmtui-connect nmtui-hostname |
4871 | - |
4872 | - install-exec-hook: |
4873 | - for link in $(links); do \ |
4874 | -- ln -f $(DESTDIR)$(bindir)/nmtui $(DESTDIR)$(bindir)/$$link; \ |
4875 | -+ cd $(DESTDIR)$(bindir) && $(LN_S) -f nmtui $$link; \ |
4876 | - done |
4877 | - |
4878 | - uninstall-hook: |
4879 | |
4880 | === removed file 'debian/patches/0004-wifi-set-wireless-power-save-for-nl80211-devices-whe.patch' |
4881 | --- debian/patches/0004-wifi-set-wireless-power-save-for-nl80211-devices-whe.patch 2015-08-20 01:07:00 +0000 |
4882 | +++ debian/patches/0004-wifi-set-wireless-power-save-for-nl80211-devices-whe.patch 1970-01-01 00:00:00 +0000 |
4883 | @@ -1,242 +0,0 @@ |
4884 | -From e5491d11b33ba90a611cb46651e724309d3b2d9e Mon Sep 17 00:00:00 2001 |
4885 | -From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
4886 | -Date: Thu, 23 Oct 2014 14:19:59 -0400 |
4887 | -Subject: [PATCH 4/5] wifi: set wireless power-save for nl80211 devices when |
4888 | - activated |
4889 | - |
4890 | -Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> |
4891 | - |
4892 | -(fixups and WEXT implementation by dcbw) |
4893 | ---- |
4894 | - src/devices/wifi/nm-device-wifi.c | 8 ++++++++ |
4895 | - src/platform/nm-linux-platform.c | 10 ++++++++++ |
4896 | - src/platform/nm-platform.c | 10 ++++++++++ |
4897 | - src/platform/nm-platform.h | 2 ++ |
4898 | - src/platform/wifi/wifi-utils-nl80211.c | 19 +++++++++++++++++++ |
4899 | - src/platform/wifi/wifi-utils-private.h | 3 +++ |
4900 | - src/platform/wifi/wifi-utils-wext.c | 25 +++++++++++++++++++++++++ |
4901 | - src/platform/wifi/wifi-utils.c | 8 ++++++++ |
4902 | - src/platform/wifi/wifi-utils.h | 2 ++ |
4903 | - 9 files changed, 87 insertions(+) |
4904 | - |
4905 | -Index: b/src/devices/wifi/nm-device-wifi.c |
4906 | -=================================================================== |
4907 | ---- a/src/devices/wifi/nm-device-wifi.c |
4908 | -+++ b/src/devices/wifi/nm-device-wifi.c |
4909 | -@@ -741,6 +741,8 @@ deactivate (NMDevice *device) |
4910 | - if (nm_device_get_initial_hw_address (device)) |
4911 | - nm_device_set_hw_addr (device, nm_device_get_initial_hw_address (device), "reset", LOGD_WIFI); |
4912 | - |
4913 | -+ nm_platform_wifi_set_powersave (NM_PLATFORM_GET, ifindex, 0); |
4914 | -+ |
4915 | - /* Ensure we're in infrastructure mode after deactivation; some devices |
4916 | - * (usually older ones) don't scan well in adhoc mode. |
4917 | - */ |
4918 | -@@ -2724,6 +2726,12 @@ act_stage2_config (NMDevice *device, NMD |
4919 | - if ((nm_ap_get_mode (ap) == NM_802_11_MODE_ADHOC) || nm_ap_is_hotspot (ap)) |
4920 | - ensure_hotspot_frequency (self, s_wireless, ap); |
4921 | - |
4922 | -+ if (nm_ap_get_mode (ap) == NM_802_11_MODE_INFRA) { |
4923 | -+ nm_platform_wifi_set_powersave (NM_PLATFORM_GET, |
4924 | -+ nm_device_get_ifindex (device), |
4925 | -+ nm_setting_wireless_get_powersave (s_wireless)); |
4926 | -+ } |
4927 | -+ |
4928 | - /* Build up the supplicant configuration */ |
4929 | - config = build_supplicant_config (self, connection, nm_ap_get_freq (ap)); |
4930 | - if (config == NULL) { |
4931 | -Index: b/src/platform/nm-linux-platform.c |
4932 | -=================================================================== |
4933 | ---- a/src/platform/nm-linux-platform.c |
4934 | -+++ b/src/platform/nm-linux-platform.c |
4935 | -@@ -3857,6 +3857,15 @@ wifi_set_mode (NMPlatform *platform, int |
4936 | - wifi_utils_set_mode (wifi_data, mode); |
4937 | - } |
4938 | - |
4939 | -+static void |
4940 | -+wifi_set_powersave (NMPlatform *platform, int ifindex, guint32 powersave) |
4941 | -+{ |
4942 | -+ WifiData *wifi_data = wifi_get_wifi_data (platform, ifindex); |
4943 | -+ |
4944 | -+ if (wifi_data) |
4945 | -+ wifi_utils_set_powersave (wifi_data, powersave); |
4946 | -+} |
4947 | -+ |
4948 | - static guint32 |
4949 | - wifi_find_frequency (NMPlatform *platform, int ifindex, const guint32 *freqs) |
4950 | - { |
4951 | -@@ -4995,6 +5004,7 @@ nm_linux_platform_class_init (NMLinuxPla |
4952 | - platform_class->wifi_get_rate = wifi_get_rate; |
4953 | - platform_class->wifi_get_mode = wifi_get_mode; |
4954 | - platform_class->wifi_set_mode = wifi_set_mode; |
4955 | -+ platform_class->wifi_set_powersave = wifi_set_powersave; |
4956 | - platform_class->wifi_find_frequency = wifi_find_frequency; |
4957 | - platform_class->wifi_indicate_addressing_running = wifi_indicate_addressing_running; |
4958 | - |
4959 | -Index: b/src/platform/nm-platform.c |
4960 | -=================================================================== |
4961 | ---- a/src/platform/nm-platform.c |
4962 | -+++ b/src/platform/nm-platform.c |
4963 | -@@ -1704,6 +1704,16 @@ nm_platform_wifi_get_ssid (NMPlatform *s |
4964 | - return klass->wifi_get_ssid (self, ifindex); |
4965 | - } |
4966 | - |
4967 | -+void |
4968 | -+nm_platform_wifi_set_powersave (NMPlatform *self, int ifindex, guint32 powersave) |
4969 | -+{ |
4970 | -+ _CHECK_SELF_VOID (self, klass); |
4971 | -+ |
4972 | -+ g_return_if_fail (ifindex > 0); |
4973 | -+ |
4974 | -+ klass->wifi_set_powersave (self, ifindex, powersave); |
4975 | -+} |
4976 | -+ |
4977 | - guint32 |
4978 | - nm_platform_wifi_get_frequency (NMPlatform *self, int ifindex) |
4979 | - { |
4980 | -Index: b/src/platform/nm-platform.h |
4981 | -=================================================================== |
4982 | ---- a/src/platform/nm-platform.h |
4983 | -+++ b/src/platform/nm-platform.h |
4984 | -@@ -499,6 +499,7 @@ typedef struct { |
4985 | - guint32 (*wifi_get_rate) (NMPlatform *, int ifindex); |
4986 | - NM80211Mode (*wifi_get_mode) (NMPlatform *, int ifindex); |
4987 | - void (*wifi_set_mode) (NMPlatform *, int ifindex, NM80211Mode mode); |
4988 | -+ void (*wifi_set_powersave) (NMPlatform *, int ifindex, guint32 powersave); |
4989 | - guint32 (*wifi_find_frequency) (NMPlatform *, int ifindex, const guint32 *freqs); |
4990 | - void (*wifi_indicate_addressing_running) (NMPlatform *, int ifindex, gboolean running); |
4991 | - |
4992 | -@@ -684,6 +685,7 @@ int nm_platform_wifi_get_quality |
4993 | - guint32 nm_platform_wifi_get_rate (NMPlatform *self, int ifindex); |
4994 | - NM80211Mode nm_platform_wifi_get_mode (NMPlatform *self, int ifindex); |
4995 | - void nm_platform_wifi_set_mode (NMPlatform *self, int ifindex, NM80211Mode mode); |
4996 | -+void nm_platform_wifi_set_powersave (NMPlatform *self, int ifindex, guint32 powersave); |
4997 | - guint32 nm_platform_wifi_find_frequency (NMPlatform *self, int ifindex, const guint32 *freqs); |
4998 | - void nm_platform_wifi_indicate_addressing_running (NMPlatform *self, int ifindex, gboolean running); |
4999 | - |
5000 | -Index: b/src/platform/wifi/wifi-utils-nl80211.c |