Commit Graph

24574 Commits

Author SHA1 Message Date
Thomas Haller
eae4ef7982 NEWS: update 2019-12-17 09:24:09 +01:00
Thomas Haller
f343f6f31d libnm/secret-agent: remove unused variable
Fixes: f0d3243f2b ('libnm/secret-agent: fix race registering secret agent')
(cherry picked from commit 5f9bcc91c7)
2019-12-17 09:00:00 +01:00
Thomas Haller
bfd41a34c0 libnm: merge branch 'th/secret-agent-register-race'
https://bugzilla.redhat.com/show_bug.cgi?id=1781084

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/364

(cherry picked from commit 85042e7244)
2019-12-16 18:55:26 +01:00
Thomas Haller
793e390c22 libnm/secret-agent: fix reseting timeout when registration completes
Fixes: f0d3243f2b ('libnm/secret-agent: fix race registering secret agent')
(cherry picked from commit 1f9dabcb73)
2019-12-16 18:54:58 +01:00
Thomas Haller
494cbe144d libnm/secret-agent: fix race registering secret agent
When NetworkManager starts, NMSecretAgentOld gets a name-owner changed
signal and registers right away.

Especially since commit ce0e898fb4 ('libnm: refactor caching of D-Bus
objects in NMClient') this hits a race where NetworkManager does not yet
export the org.freedesktop.NetworkManager.AgentManager interface and
the registration fails:

   GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.NetworkManager.AgentManager” on object at path /org/freedesktop/NetworkManager/AgentManager

Previously, when NMClient recevied a name-owner changed, that would
block the main loop long enough to avoid the race. Note that NMClient
has nothing to do with NMSecretAgentOld, however in practice all
applications that use NMSecretAgentOld also use NMClient.

While we should fix the race server-side, we also need to work around it
in the client. Retry.

Also, make the async request actually cancellable and actually honor the passed
GCancellable.

Check output:

    $ LIBNM_CLIENT_DEBUG=trace ./clients/cli/nmcli agent secret |& grep secret-agent
    libnm-dbus: <trace> [21399.04862] secret-agent[2f2af4ee102d7570]: create new instance
    libnm-dbus: <trace> [21399.04863] secret-agent[2f2af4ee102d7570]: init-sync
    libnm-dbus: <trace> [21404.08147] secret-agent[2f2af4ee102d7570]: name owner changed: (null)
    libnm-dbus: <trace> [21404.09085] secret-agent[2f2af4ee102d7570]: name owner changed: ":1.2504"
    libnm-dbus: <trace> [21404.09085] secret-agent[2f2af4ee102d7570]: register: starting asynchronous registration...
    libnm-dbus: <trace> [21404.09178] secret-agent[2f2af4ee102d7570]: register: registration failed with error "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.NetworkManager.AgentManager” on object at path /org/freedesktop/NetworkManager/AgentManager". Retry in 0 msec...
    libnm-dbus: <trace> [21404.09178] secret-agent[2f2af4ee102d7570]: register: retry registration...
    libnm-dbus: <trace> [21404.09195] secret-agent[2f2af4ee102d7570]: register: registration failed with error "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.NetworkManager.AgentManager” on object at path /org/freedesktop/NetworkManager/AgentManager". Retry in 4 msec...
    libnm-dbus: <trace> [21404.09236] secret-agent[2f2af4ee102d7570]: register: retry registration...
    [...]
    libnm-dbus: <trace> [21405.01782] secret-agent[2f2af4ee102d7570]: register: registration failed with error "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.NetworkManager.AgentManager” on object at path /org/freedesktop/NetworkManager/AgentManager". Retry in 128 msec...
    libnm-dbus: <trace> [21405.03063] secret-agent[2f2af4ee102d7570]: register: retry registration...
    libnm-dbus: <trace> [21405.03068] secret-agent[2f2af4ee102d7570]: register: registration failed with error "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.NetworkManager.AgentManager” on object at path /org/freedesktop/NetworkManager/AgentManager". Retry in 128 msec...
    libnm-dbus: <trace> [21405.04354] secret-agent[2f2af4ee102d7570]: register: retry registration...
    libnm-dbus: <trace> [21406.01097] secret-agent[2f2af4ee102d7570]: register: registration succeeded

(cherry picked from commit f0d3243f2b)
2019-12-16 18:54:33 +01:00
Thomas Haller
37f1c52fa9 libnm/secret-agent: use GTask for nm_secret_agent_old_register*()
This change is of course right and read nicer. Also, the GTask captures the
current g_main_context_get_thread_default(). We will need that next.

(cherry picked from commit cff4e937ac)
2019-12-16 18:54:12 +01:00
Thomas Haller
eeb3a25ca2 libnm/secret-agent: support debug logging from secret-agent
(cherry picked from commit 392befb5fd)
2019-12-16 18:54:12 +01:00
Thomas Haller
c414173fa9 libnm/secret-agent: drop fallback to Register() method for secret-agent
RegisterWithCapabilities() is supported since NetworkManager 0.9.9.1. Of course,
we don't support such old server anymore (also, because we require the standard
D-Bus interfaces like ObjectManager).

(cherry picked from commit 263aa63caa)
2019-12-16 18:54:12 +01:00
Thomas Haller
2b0533012a libnm: allow using _LOGx() macros in libnm
(cherry picked from commit 1b0f0f8c47)
2019-12-16 18:54:12 +01:00
Thomas Haller
e20c8d8ad5 shared: implement _LOGx() macros using log levels that are themself defines
"nm-glib-aux/nm-logging-fwd.h" provides macros like _LOGD() to be reused
by various parts which implement logging (by defining _NMLOG() accordingly).

libnm also has logging, however it uses different logging levels
aside LOGD_DEBUG.

Instead, implement _LOGD() using a define _LOGL_DEBUG, so that libnm can
redefine thos _LOGL_DEBUG defines and use the _LOGD() macro.

(cherry picked from commit 1b00fd2fd2)
2019-12-16 18:54:12 +01:00
Thomas Haller
452f14216a shared: add nm_dbus_error_is() helper
(cherry picked from commit ce36494c0a)
2019-12-16 18:54:12 +01:00
Thomas Haller
809d70ee64 all: fix wrong "gs_free GError *" declarations
This is a bug and leads either to a leak or a crash.

(cherry picked from commit 4a3ca7115a)
2019-12-16 17:45:18 +01:00
Thomas Haller
2fa4827eb9 checkpatch: catch "gs_free GError *" declations
(cherry picked from commit ec0adbfaf0)
2019-12-16 17:45:16 +01:00
Thomas Haller
f49ce41214 client: fallback to CLOCK_MONOTONIC for timerfd
RHEL7 supports clock_gettime(CLOCK_BOOTIME), but it does not support
timerfd_create(CLOCK_BOOTIME). Creating a timerfd will fail with EINVAL.
Fallback to CLOCK_MONOTONIC.

Compare this to n-acd which also has compatibility code to fallback to
CLOCK_MONOTONIC. However when n-acd falls back to CLOCK_MONOTONIC, it uses
monotonic clock also for clock_gettime().

For n-dhcp4, the timestamps are also exposed in the public API
(n_dhcp4_client_lease_get_lifetime()). Hence, for timestamps n-dhcp4
still uses and requires clock_gettime(CLOCK_BOOTIME). Only the internal
timeout handling with the timerfd falls back to CLOCK_MONOTONIC.

https://github.com/nettools/n-dhcp4/pull/13
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/362
(cherry picked from commit a1771c738d)
2019-12-15 13:51:44 +01:00
Beniamino Galvani
944ff9f9dc manager: create a virtual device only if the connection can autoconnect
The autoconnection for virtual devices currently works in two
phases. First we detect that there is suitable profile that can
autoconnect and we realize the device. Then, when the device becomes
'disconnected', autoconnect kicks in and starts the activation.

However, if autoconnect is blocked for a device, currently we do step
1 without step 2, leaving a stale interface around. Fix this by also
checking that autoconnect is not blocked during step 1.

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/360
(cherry picked from commit 6c716912eb)
2019-12-15 09:37:25 +01:00
Beniamino Galvani
f1d4853927 device: don't reapply IP configuration if the ifindex is missing
Assertions will fail in ip_config_merge_and_apply() if the device
doesn't have an ifindex. Reproducible with:

 $ nmcli connection add type ovs-bridge ifname ovs0 ipv4.method disabled ipv6.method disabled
 Connection 'ovs-bridge-ovs0' (1d5e794b-10ad-4b2b-aa7c-5ca7e34b0a55) successfully added

 $ nmcli device reapply ovs0
 Error: Reapplying connection to device '(null)' (/org/freedesktop/NetworkManager/Devices/16) failed: Remote peer disconnected

 $ journalctl -u NetworkManager -e
 ...
 NetworkManager[73824]: nm_ip4_config_add_dependent_routes: assertion 'ifindex > 0' failed
 systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=5/TRAP
 ...

(cherry picked from commit 6d6e1402dc)
2019-12-14 21:05:54 +01:00
Beniamino Galvani
3381299562 ovs: check state before starting ip configuration after link change
When the link becomes available, check that the device is in the
ip-config state before starting ip configuration. Also, reset the
'waiting_for_interface' flag when the device deactivates.

https://bugzilla.redhat.com/show_bug.cgi?id=1781165
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/358
(cherry picked from commit 0738c10445)
2019-12-14 21:05:53 +01:00
Thomas Haller
3e77f0a5a8 cloud-setup/trivial: rename timeout_ms to timeout_msec
I think "ms" as abbreviation is too short and unclear. Also, it's
not used consistently. Rename variable.

(cherry picked from commit 13741aa952)
2019-12-13 17:47:05 +01:00
Thomas Haller
490c46e527 meson/build: avoid using ternary as it breaks older meson
See mesonbuild issue 5003.

Oddly, this isn't inside a method call, while we use ternaries
inside a method calls otherwise. Anyway, workaround this and
avoid the crash.

Fixes: c21c6bc0be ('build/meson: allow configuring default for main.auth-polkit setting')
(cherry picked from commit 0e3400bef7)
2019-12-13 14:58:49 +01:00
Thomas Haller
d8cc6af058 shared/glib: reimplement g_atomic_pointer_compare_and_exchange() macro
With glib 2.63.2 and clang 9.0.0 (Fedora 32) we get compile errors:

  ../clients/cloud-setup/nmcs-provider-ec2.c:51:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const char **' [-Werror,-Wincompatible-pointer-types]
                  if (!g_atomic_pointer_compare_and_exchange (&base_cached, NULL, base))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/bluetooth/nm-bluez-manager.c:2836:2: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const NMBtVTableNetworkServer **' (aka 'const struct _NMBtVTableNetworkServer **') [-Werror,-Wincompatible-pointer-types]
          g_atomic_pointer_compare_and_exchange (&nm_bt_vtable_network_server, NULL, &priv->vtable_network_server);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/bluetooth/nm-bluez-manager.c:2853:2: error: passing 'typeof ((&priv->vtable_network_server)) *' (aka 'struct _NMBtVTableNetworkServer **') to parameter of type 'const NMBtVTableNetworkServer **' (aka 'const struct _NMBtVTableNetworkServer **') discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
          g_atomic_pointer_compare_and_exchange (&nm_bt_vtable_network_server, &priv->vtable_network_server, NULL);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/nm-device.c:8857:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'GBytes **' (aka 'struct _GBytes **') [-Werror,-Wincompatible-pointer-types]
                  if (!g_atomic_pointer_compare_and_exchange (&global_duid, NULL, p)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~

The issue happens because glib passes the "atomic" argument to

  __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)

without cast, and clang 9 seems to be picky about const pointers.
Add our own version of the macro that does better casts while also having
better compile time checks for valid arguments.

(cherry picked from commit f5b0713651)
2019-12-13 13:48:00 +01:00
Thomas Haller
dc981b12a9 clients/tests: merge branch 'th/clients-test-select-fields'
(cherry picked from commit 4711019d34)
2019-12-13 13:20:58 +01:00
Thomas Haller
30b7ab6cb9 clients/tests: add test for selecting fields from multiple connections with nmcli con show
(cherry picked from commit f230342478)
2019-12-13 13:20:57 +01:00
Thomas Haller
64f103416f clients/tests: support Util.replace_text_sort_list() helper
This will be necessary to sort a list of text that contains text to
replace. The use case is to get all UUIDs from the server, but some
of these UUIDs are dynamic. So, in order to have a fixed sort order,
we need to handle sorting the list, based on the replacement.

(cherry picked from commit 347253be2f)
2019-12-13 13:20:57 +01:00
Thomas Haller
1a20c9b2b5 clients/tests: add NMStubServer.findConnections() helper function
Will be used to get all connection from the test stub server.

(cherry picked from commit 0d24ac4996)
2019-12-13 13:20:57 +01:00
Thomas Haller
50d7b1cd7c clients/tests: support replacing UUIDs in command text
We want to issue a nmcli command with the connection's UUID in the command
line. As the command line is stored to disk and compared, we cannot use UUIDs
that are randomly generated. Instead, we need to support replacing the text
in the command line.

(cherry picked from commit 7d048f1a5b)
2019-12-13 13:20:57 +01:00
Thomas Haller
c1513a5d7c clients/tests: fix wrongly constructing command line string as tuple in TestNmcli
It had no bad effect, but the cmd was a tuple with one string, and not
a string.

(cherry picked from commit 52b89cb21b)
2019-12-13 13:20:57 +01:00
Thomas Haller
e1d1e9150c clients/tests: support string arguments to Util.replace_text()
(cherry picked from commit 48225add3a)
2019-12-13 13:20:57 +01:00
Thomas Haller
03102696a8 clients/tests: rename "replace_stdout" variable to "replace_uuids"
The variable name should say what it is, not what it is used for.
E.g. we would use the very same replacements for stderr. Rename
so that it can (by its name) used for different purposes.

(cherry picked from commit ffc235c30d)
2019-12-13 13:20:57 +01:00
Thomas Haller
4ea999ac94 gitlab-ci: fix generating "pages" after switching to Fedora 30 for main build
(cherry picked from commit c15682558c)
2019-12-13 11:48:25 +01:00
Alexey Kodanev
c95bdb21a7 nm-manager: restore passing correct size to sendfile in copy_lease()
Otherwise sendfile() fails with EINVAL when the file offset
is greater than zero (pos + size > max), always on the second
iteration.

Fixes: 0c6cd07ec8 ('nm-manager: remove lease file if copying dhclient lease fails')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/359
(cherry picked from commit 70ebdc7730)
2019-12-12 08:08:11 +01:00
Beniamino Galvani
61d431a9e8 manager: forbid autoactivation of parent when it is blocked by user request
If a device is being autoactivated and requires a parent that is
blocked due to user request, the autoactivation attempt should fail
because NM shouldn't overrule the user decision.

https://bugzilla.redhat.com/show_bug.cgi?id=1765566
(cherry picked from commit f2dbf8fbc0)
2019-12-11 13:48:52 +01:00
Beniamino Galvani
73a2557a6f merge: branch 'bg/mtu-reapply-rh1779162'
https://bugzilla.redhat.com/show_bug.cgi?id=1779162
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/356
(cherry picked from commit ce2cceef83)
2019-12-11 13:41:27 +01:00
Beniamino Galvani
1191eba15a device: always allow reapply of MTU from wired setting
Many device types take the MTU value from the wired setting; usually
they don't implement the can_reapply_change() method and so the MTU
can't be changed with the Reapply() API.

Instead of implementing the method for all such devices to support the
same property (adding a lot of duplicated code), add a check in
NMDevice to allow the reapply of MTU when we recognize that the device
uses the MTU from the wired setting.

Device types can still decide to implement can_reapply_change() and
support whatever properties they want, even from the wired setting.

(cherry picked from commit 9339d3310e)
2019-12-11 13:40:30 +01:00
Beniamino Galvani
1aedf60244 infiniband: allow reapply of MTU
(cherry picked from commit ceeefa82c5)
2019-12-11 13:40:29 +01:00
Thomas Haller
76240cbe2b core/auth: merge branch 'th/polkit-root-only'
https://bugzilla.redhat.com/show_bug.cgi?id=1762011

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/357

(cherry picked from commit 218fd9e1fc)
2019-12-11 13:13:05 +01:00
Thomas Haller
096da3a046 config: print config warnings during NetworkManager --print-config
(cherry picked from commit fd8c8ffe0d)
2019-12-11 13:13:05 +01:00
Thomas Haller
74d0571cb4 config: emit warning about invalid main.auth-polkit setting
(cherry picked from commit 8f96d3cb0c)
2019-12-11 13:13:05 +01:00
Thomas Haller
e7e0909d44 config: add nm_config_data_get_warnings() to get additional warnings about wrong configuration
No additional warnings are implemented yet.

(cherry picked from commit 8d20b9363b)
2019-12-11 13:13:05 +01:00
Thomas Haller
62c9d8c109 config: return GPtrArray with warnings from internal read_entire_config() function
The underlying GPtrArray that we use to construct the list of warnings
is more useful than the strv array. For the internal function, don't
let it return the strv array but instead take (and fill) the warnings
as GPtrArray. There is no difference in practice, because also
previously we would always create an empty GPtrArray.

(cherry picked from commit 6998c5f129)
2019-12-11 13:13:05 +01:00
Thomas Haller
a0a5b0b2f5 core: add main.auth-polkit option "root-only"
We always build with PolicyKit support enabled, because it has no
additional dependencies, beside some D-Bus calls.

However, in NetworkManager.conf the user could configure
"main.auth-polkit" to disable PolicyKit. However, previously it would
only allow to disable PolicyKit while granting access to all users.

I think it's useful to have an option that disables PolicyKit and grants
access only to root. I think we should not go too far in implementing
our own authorization mechanisms beside PolicyKit (e.g. you cannot
disable PolicyKit and grant access based on group membership of the
user). However, disabling PolicyKit can be useful sometimes, and it's
simple to implement a "root-only" setup.

Note one change is that when NetworkManager now runs without a D-Bus
connection (in initrd), it would deny all non-root requests. Previously
it would grant access. I think there should be little difference in
practice, because if we have no D-Bus we also don't have any requests to
authenticate.

(cherry picked from commit 6d7446e52f)
2019-12-11 13:13:05 +01:00
Thomas Haller
d27fcd0754 build/meson: allow configuring default for main.auth-polkit setting
We always build PolicyKit support, because it merely depends on some
D-Bus calls. However, there are two things to configure:

 - the default value for main.auth-polkit in NetworkManager.conf. This
   is now called "-Dconfig_auth_polkit_default=$VAL".

 - whether to install the policy file. This is called "-Dpolkit=$VAL".

These settings are mostly independent, so add "config_auth_polkit_default" to
make the default explicitly configurable.

(cherry picked from commit c21c6bc0be)
2019-12-11 13:13:05 +01:00
Thomas Haller
2534be89a1 nm-manager: remove lease file if copying dhclient lease fails
- also use nm_auto_close and nm_close().

(cherry picked from commit 0c6cd07ec8)
2019-12-11 10:07:12 +01:00
Alexey Kodanev
abeaf6ffc3 nm-manager: fix selinux label for dhclient lease file from initramfs
When moving a lease file from initramfs directory to NetworkManager
run directory, SELinux label for that file retains tmpfs_t type.

Fix it by using sendfile() instead of rename(). That way, the
lease file will have the default type: NetworkManager_var_run_t.
Since we take ownership of the lease file, also drop it from the
old location.

* Before the patch:
ls -Z /var/run/NetworkManager/dhclient-*.lease
system_u:object_r:tmpfs_t:s0 dhclient-13162c00-abfb-4e28-bbfb-170187ddd044-ens3.lease

* After:
ls -Z /var/run/NetworkManager/dhclient-*.lease
system_u:object_r:NetworkManager_var_run_t:s0 dhclient-f47d1908-67ae-49c6-bd5e-19a690d85526-ens3.lease

Fixes: f2fe6c03ee ('manager: don't treat the initramfs-configured DHCP connections as generated')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/353
(cherry picked from commit ce1f9e6eb9)
2019-12-11 10:07:11 +01:00
Thomas Haller
cf7662bc52 n-dhcp4/socket: use SO_REUSEADDR on UDP socket
Otherwise, other applications cannot bind to port 0.0.0.0:68 at the same time.
This is for example what dhclient wants to do. So even when running
dhclient on another, unrelated interface, it would fail to bind the UDP
socket and quit.

Note that also systemd-networkd's DHCPv4 client sets this socket option.
Presumably for the same reasons.

Signed-off-by: Thomas Haller <thaller@redhat.com>

https://github.com/nettools/n-dhcp4/pull/12
(cherry picked from commit 53b74bc614)
2019-12-11 09:25:05 +01:00
Beniamino Galvani
d33bea21b7 cli: expose device D-Bus path
https://bugzilla.redhat.com/show_bug.cgi?id=1745574
(cherry picked from commit 622eef4882)
2019-12-10 17:58:56 +01:00
Thomas Haller
7e8a5d98e3 settings: assert that we don't leak error variable in impl_settings_load_connections()
(cherry picked from commit e0569ee575)
2019-12-09 09:55:16 +01:00
Thomas Haller
6d37f690ad settings: fix use after free in keyfile's load_connections()
Fixes: d35d3c468a ('settings: rework tracking settings connections and settings plugins')
(cherry picked from commit eb642fecdf)
2019-12-09 09:55:15 +01:00
Thomas Haller
8bcb48ee3b libnm/docs: fix gtk-doc for #NMDhcpHostnameFlags
(cherry picked from commit 4eed1a6596)
2019-12-09 07:49:49 +01:00
Beniamino Galvani
366b90db87 device: don't transition assumed devices to FAILED before ACTIVATED
If the activation of an assumed device fails, we first set the device
state to FAILED and then to ACTIVATED. In the FAILED state, the active
connection transitions to DEACTIVATED and clears its device pointer;
hence we end up with an inconsistent state which causes assertion
failures in other parts of the code (for example, get_best_ip_config()
assumes that the device of the best active connection is not NULL).

Don't first transition to FAILED and then to ACTIVATED, just set the
latter.

https://bugzilla.redhat.com/show_bug.cgi?id=1737774
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/351
(cherry picked from commit 93e9010b75)
2019-12-05 17:11:36 +01:00
Thomas Haller
40a7d13666 initrd: merge branch 'th/initrd-parse-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/282

(cherry picked from commit abaad34fd2)
2019-12-05 13:12:04 +01:00