Commit graph

14867 commits

Author SHA1 Message Date
Thomas Haller
fba19c43ee settings: emit NM_SETTINGS_CONNECTION_UPDATED right away and not on an idle handler
I want to combine NM_SETTINGS_CONNECTION_UPDATED and NM_SETTINGS_CONNECTION_UPDATED_BY_USER
into one signal. Thus, they must have same behavior with respect as to whether they are
scheduled on idle.

Emit NM_SETTINGS_CONNECTION_UPDATED right away.

The "Updated" signal is exposed via D-Bus on the settings object.
Removing the idle handling has no bad consequences there.

Apart from that, the signal has only the listener NMSettings::connection_updated().
connection_updated() first emits NM_SETTINGS_SIGNAL_CONNECTION_UPDATED, which only
has listener: NMPolicy::connection_updated(), which already delegates to
an idle handler.

Second, NMSettings::connection_updated() emits
NM_CP_SIGNAL_CONNECTION_UPDATED which has the following listeners:

  - NMBluezDevice::cp_connection_updated(), which can cause the
    connection to be tracked/untracked. Any further changes are
    already delayed on an idle handler (check_emit_usable_schedule()).

  - NMDevice::cp_connection_added_or_updated(), which causes the
    connection to be tracked by the device. It also emits
    "notify::available-connections", which however is only relevant
    for the D-Bus bindings.
    At last, it does available_connections_check_delete_unrealized()
    which also is on an idle handler already.

(cherry picked from commit a4f1a1794f)
2016-05-24 15:03:20 +02:00
Thomas Haller
887fc983be device/bluez: delay check_emit_usable() for NM_CP_SIGNAL_CONNECTION_UPDATED
Currently, NM_CP_SIGNAL_CONNECTION_UPDATED signal will be invoked on an
idle handler. I want to change that, so to be save, delay actions that
matter on an idle handler.

(cherry picked from commit 640ef67cd7)
2016-05-24 15:03:18 +02:00
Thomas Haller
30590effc8 device/bluez: refactor registering to connections
No (intentional) change in behavior.

(cherry picked from commit 3325cd3d90)
2016-05-24 15:03:17 +02:00
Thomas Haller
946fb983f6 policy: handle schedule_activate_all() in an idle handler
schedule_activate_all() needs to iterate over all devices and is thus
relatively costly (and scales O(n^2)).

By scheduling the action on an idle handler we delay and combine
multiple redundant requests.

Another reason is that NM_SETTINGS_CONNECTION_UPDATED is currently
executed on an idle handler which first leads to
NM_SETTINGS_SIGNAL_CONNECTION_UPDATED signal and eventually calls
schedule_activate_all().
I want to change that to emit the connection update signal immediately,
thus to preserve the delay, we delay handling in NMPolicy.

(cherry picked from commit 920054d8aa)
2016-05-24 15:03:16 +02:00
Thomas Haller
8b357f43c6 settings: drop signal slots from NMSettings
NMSettings has no derived classes and obviously nobody is using
those slots. Just drop them.

(cherry picked from commit d571933505)
2016-05-24 15:03:13 +02:00
Thomas Haller
480e69cc82 settings: refactor connection_changed()
Again, no functional change.

(cherry picked from commit f7e7df772d)
2016-05-24 15:03:12 +02:00
Thomas Haller
6359213ea4 settings: refactor connection-changed handler
No change in behavior, just not pass on this GUINT_TO_POINTER (TRUE).

(cherry picked from commit 866df17e97)
2016-05-24 15:03:11 +02:00
Thomas Haller
c70d6bf498 settings: use NM_GOBJECT_PROPERTIES_DEFINE in NMSettings/NMSettingsConnection/NMActiveConnection
(cherry picked from commit 30b8842a48)
2016-05-24 15:03:09 +02:00
Thomas Haller
a6634183e1 device: drop available_connections_notify() and call _notify() directly
(cherry picked from commit 8c86648313)
2016-05-24 15:03:08 +02:00
Thomas Haller
f4113b8b24 manager: fix implementation of NMManager's "startup-complete
Due to a bug, NMManager would connect to "notify::connections"
and might miss an important notification when NMSettings declares
startup-complete.

Fixes: b067ca7034
(cherry picked from commit c57e5a6b66)
2016-05-24 15:03:06 +02:00
Beniamino Galvani
a97ba456fe config: add file name to error messages for parsing failures
When one of the configuration snippet is malformed, NM doesn't tell
which file caused the error:

$ NetworkManager --print-config
Failed to read configuration: Key file does not start with a group

Fix this.

$ NetworkManager --print-config
Failed to read configuration: /usr/lib/NetworkManager/conf.d/test.conf: Key file does not start with a group

(cherry picked from commit 57c001200d)
2016-05-19 18:13:55 +02:00
Beniamino Galvani
1cedca3e69 cli: remove wrong assertion in check_valid_name()
As explained in the function comment, a NULL value for @val is
acceptable. Otherwise:

$ nmcli connection edit
 (process:2276): nmcli-CRITICAL **: check_valid_name: assertion 'val' failed

Fixes: fb8fe1d8cb
(cherry picked from commit 73221a809d)
2016-05-19 17:13:03 +02:00
Thomas Haller
1b815346aa clients: fix build error for missing nm_vpn_plugin_info_get_service() after bad backport
nm_vpn_plugin_info_get_service() is new API on master, not available here.
Reimplement it.

Fixes: 7c209b2a7d
2016-05-19 13:23:40 +02:00
Thomas Haller
2c34cd9ab5 cli: merge branch 'th/cli-vpn-import-fixes-rh1337300'
https://bugzilla.redhat.com/show_bug.cgi?id=1337300

(cherry picked from commit 3d25b2e1a1)
2016-05-19 13:12:43 +02:00
Thomas Haller
964baa0e33 clients,cli: show better error message when failing to load VPN plugin
VPN plugins are often not installed or they might be legacy-only.
In both cases we should show a better error message about the
failure reason.

(cherry picked from commit d0f01aa2c2)
2016-05-19 13:12:02 +02:00
Thomas Haller
7c209b2a7d clients,cli: for connection-add consider VPNs as loaded from the plugin
Instead of using (only) a hard-coded list of VPN types,
prefer lookup the VPN settings from the .name files.

Still, fallback to a hard-coded list if the plugin cannot
be found, because for connection-add we currently don't
actually need the plugin installed.

(cherry picked from commit 41976e3069)
2016-05-19 13:12:02 +02:00
Thomas Haller
83ea6abc6c clients: don't assert against existance of plugin in nm_vpn_supports_ipv6()
Obviously, loading a plugin can fail easily.

(cherry picked from commit 2b4b9d34e4)
2016-05-19 13:12:02 +02:00
Thomas Haller
be9e068654 clients: lookup VPN plugins either by "name" or "service"
... not constructing a "service" by prepending a D-Bus prefix to "name" (urgh).

(cherry picked from commit 0225c4567b)
2016-05-19 13:12:02 +02:00
Thomas Haller
981e5f6716 nmcli-completion: complete filename for VPN import and passwd-file
Also hard-code the VPN types strongswan and fortisslvpn.

https://bugzilla.redhat.com/show_bug.cgi?id=1337300
(cherry picked from commit 09a015b23b)
2016-05-19 13:12:02 +02:00
Michael Olbrich
10ba492047 sleep-monitor-upower: add missing include
Otherwise building fails with:

  nm-sleep-monitor-upower.c:132:45: error: expected declaration specifiers or '...' before 'nm_sleep_monitor_get'
  nm-sleep-monitor-upower.c:132:67: error: expected declaration specifiers or '...' before '(' token

https://mail.gnome.org/archives/networkmanager-list/2016-May/msg00053.html
2016-05-19 12:41:12 +02:00
Thomas Haller
1d78b173bd NEWS: fix mistake in NEWS file about wifi.mac-address-randomization
(cherry picked from commit e0e1c59160)
2016-05-19 12:12:30 +02:00
Beniamino Galvani
0fd523c58d cli: append newline to failure message
Fixes: a06487a6ae
(cherry picked from commit dbd0634c84)
2016-05-16 17:56:08 +02:00
Beniamino Galvani
1d4a9e64fb device: merge branch 'bg/dhcp-assumed-generated-route-rh1265239'
https://bugzilla.redhat.com/show_bug.cgi?id=1265239
(cherry picked from commit adb534518b)
2016-05-16 15:48:53 +02:00
Beniamino Galvani
c65baf3121 device: take care of default route of DHCP generated-assumed connections
In general we don't touch the externally set default route on devices
that use a generated-assumed connection. When the IP method is AUTO
(or DHCP), this means that we are not able to restore the default
route after a temporary expiration of the lease which removes
addresses/routes from the device.

Change this, and let NM update the default route for generated-assumed
devices using dynamic addressing.

https://bugzilla.redhat.com/show_bug.cgi?id=1265239
(cherry picked from commit 9b7f9af077)
2016-05-16 15:47:33 +02:00
Beniamino Galvani
1d01cd587c device: don't update applied connection for generated assumed devices
The applied connection must describe the configuration that was
initially activated on the device. Even if the IP configuration
changes, we shouldn't reset the applied connection for devices using a
generated-assumed connection, otherwise we would lose information on
the IP method we're trying on the device.

(cherry picked from commit c84fd50287)
2016-05-16 15:47:29 +02:00
Beniamino Galvani
2959977164 device: apply MTU setting also to devices without IPv4 configuration
Usually the MTU in the ethernet.mtu property is applied to the device
during the commit of IPv4 configuration.  For devices with
ipv4.method=disabled or slave devices that phase is skipped and so the
setting does not have effect.  Apply the MTU explicitly in such cases.

https://bugzilla.redhat.com/show_bug.cgi?id=1303968
https://bugzilla.redhat.com/show_bug.cgi?id=1303731
(cherry picked from commit 53dfaddda2)
2016-05-16 10:57:27 +02:00
Thomas Haller
38ce17b8b9 man: minor rewording in NetworkManager.conf about connection.stop-match
(cherry picked from commit 7d0119d249)
2016-05-13 19:33:06 +02:00
Dan Williams
3cba4194f2 manager: don't unmanage devices without L3 config on shutdown
Use the following logic when quitting, if the device is managed:

  1) if the connection is assumed, leave it up
  2) if the device has no connection (eg, !req) leave it up
  3) if the device only has L2 leave it up

[thaller@redhat.com: original patch reworked by bgalvani@redhat.com and me]

https://bugzilla.redhat.com/show_bug.cgi?id=1311988
https://bugzilla.redhat.com/show_bug.cgi?id=1333983

(cherry picked from commit 25aaaab3b7)
(cherry picked from commit dab2d46aa2)
2016-05-13 19:30:11 +02:00
Thomas Haller
9a37d1d970 libnm: don't require initialized @out_encrypted argument in nm_utils_file_is_private_key()
No need to require the caller to initialize the optional out-argument.
Otherwise we get:

  (nm-connection-editor:2471): libnm-CRITICAL **: nm_utils_file_is_private_key: assertion 'out_encrypted == NULL || *out_encrypted == FALSE' failed

https://bugzilla.gnome.org/show_bug.cgi?id=763578

Fixes: 1c4f41c610
(cherry picked from commit 81499355b0)
2016-05-13 14:26:52 +02:00
Beniamino Galvani
5660bbfacc cli: also hide phase2 private key unless --show-secrets is passed
Fixes: ca6f1e7f25
(cherry picked from commit c094ee5f90)
2016-05-13 14:02:27 +02:00
Beniamino Galvani
a91bd2fab2 cli: hide secret certificate blobs unless --show-secrets is passed
Client certificate and private key blobs should be considered private
as other secrets and not shown unless the --show-secrets option is
passed.

https://bugzilla.redhat.com/show_bug.cgi?id=1184530
(cherry picked from commit ca6f1e7f25)
2016-05-13 11:54:42 +02:00
Thomas Haller
ddefd6931e settings: fix write_hostname for relative-symbolic links
g_file_read_link() "reads" the symbolic link. If it's a relative path,
we get a relative path which is anchored on @file. We must resolve that
to be absolute.

(cherry picked from commit 7f7e1eb60b)
2016-05-12 15:28:05 +02:00
Thomas Haller
51188fb046 settings: remove unnecessary "file" field for hostname from NMSettingPrivate
(cherry picked from commit d6e7fa164b)
2016-05-12 15:28:05 +02:00
Thomas Haller
9ebc6e1157 utils: fix memleak in nm_utils_read_link_absolute()
Fixes: c4b88bf23f
(cherry picked from commit d3be90e3e7)
2016-05-12 15:28:05 +02:00
Thomas Haller
9e66849f54 utils: add nm_utils_read_link_absolute()
(cherry picked from commit c4b88bf23f)
2016-05-12 15:27:41 +02:00
Thomas Haller
0c3dc9d326 device: merge branch 'th/device-ip-config-on-link-up-rh1309899'
https://bugzilla.redhat.com/show_bug.cgi?id=1309899

(cherry picked from commit 05010747b2)
2016-05-12 15:08:09 +02:00
Thomas Haller
11bfe8a881 platform: ensure refetching routes when link goes down
It's not enough to consider IF_LOWER_UP flag. Instead,
the important flag is actually IF_UP.

Actually, I suspect that IF_LOWER_UP is not needed. But for
now leave it, in order not to break something.

(cherry picked from commit 02e84ba1e8)
2016-05-12 15:07:26 +02:00
Thomas Haller
5367eac814 device: restore IP configuration when link comes up
This is especially important, because changing MTU takes the
link down for a moment. Taking a link down deletes IP routes and
IPv6 addresses. Thus, when the link comes up again, we must restore
them.

Otherwise, we don't call merge_and_apply() until the next DHCP lease
(or possibly never in case of static addressing).

https://bugzilla.redhat.com/show_bug.cgi?id=1309899
(cherry picked from commit 35a7ea77b0)
2016-05-12 15:07:25 +02:00
Thomas Haller
a3b3e17bf9 device: improve logging when changing IP configuration
nm_device_set_ip4_config() is called during cleanup and
from ip4_config_merge_and_apply(). The latter, has several
call sites.

It's not easy to track whether we called set_ip4_config with
or without commit (and if we call it without commit, we might
not see a logging line at all).

(same for nm_device_set_ip6_config()/ip6_config_merge_and_apply()).

(cherry picked from commit f50e39fc98)
2016-05-12 15:07:23 +02:00
Thomas Haller
b04db262cb all: replace nm_unauto() by g_steal_pointer()
They do essentially the same.

(cherry picked from commit ba90c9601c)
2016-05-12 14:35:14 +02:00
Thomas Haller
cd0dd3b0bf nm-glib: backport g_steal_pointer() from glib-2.44
(cherry picked from commit 5d1c4ca6c4)
2016-05-12 14:35:12 +02:00
Thomas Haller
7d2458e51c vpn: fix crash when VPN service times-out to start
Previously, we took a reference when scheduling _daemon_exec_timeout().
That was changed, but we still wrongly unref'ed the VPN connection
on timeout.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=766307

Fixes: 6c12f04e87
(cherry picked from commit 1ec5e0b958)
2016-05-12 13:03:07 +02:00
Lubomir Rintel
97f317af7a release: bump version to 1.2.3 (development) 2016-05-11 14:52:02 +02:00
Lubomir Rintel
8f6d416768 release: bump version to 1.2.2 2016-05-11 13:24:08 +02:00
Lubomir Rintel
b198efb28f release: update NEWS 2016-05-11 13:24:08 +02:00
Lubomir Rintel
1c7668f896 dnsmasq: don't add router option for non-default-route connections
This is useful to set up a DHCP server, but don't hijack the default
route of the clients.

(cherry picked from commit 9770024f63)
2016-05-11 12:49:25 +02:00
Thomas Haller
e35d3bfb41 sd/dhcp: workaround multiple "Domain Name" (option 15) entries
https://mail.gnome.org/archives/networkmanager-list/2005-April/msg00022.html
https://tools.ietf.org/html/rfc2132#section-3.17
https://bugzilla.gnome.org/show_bug.cgi?id=766191
(cherry picked from commit 2e710c2e10)
2016-05-11 11:18:20 +02:00
Mingye Wang (Arthur2e5)
002bdb8b0a po: update Simplified Chinese (zh_CN) translation (bgo #765787)
https://bugzilla.gnome.org/show_bug.cgi?id=765787
(cherry picked from commit e27b571081)
2016-05-10 19:45:07 +02:00
Anders Jonsson
f9917e1605 po: update Swedish (sv) translation (bgo #766194)
https://bugzilla.gnome.org/show_bug.cgi?id=766194
2016-05-10 19:32:32 +02:00
Rafael Fontenelle
8bd904712f po: update Brazilian Portuguese (pt_BR) translation (bgo#765974)
https://bugzilla.gnome.org/show_bug.cgi?id=765974
2016-05-10 19:14:19 +02:00