Commit graph

22487 commits

Author SHA1 Message Date
Thomas Haller
7a0f8520ff core: fix file permissions for "/var/lib/NetworkManager/secret_key"
Ooherwise, the file has wrong permissions:

  # ls -la /var/lib/NetworkManager/secret_key
  ----r-xr-x. 1 root root 50 May 14 13:52 /var/lib/NetworkManager/secret_key

Luckily, /var/lib/NetworkManager should be already

  # ls -lad /var/lib/NetworkManager
  drwx------. 2 root root 8192 May 14 13:57 /var/lib/NetworkManager

which mitigates this a bit.

Fixes: dbcb1d6d97 ('core: let nm_utils_secret_key_read() handle failures internally')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/175
(cherry picked from commit dc3a2f9bc4)
(cherry picked from commit 2d46247c6a)
2019-05-14 14:04:51 +02:00
Thomas Haller
1337ebd9d0 settings/d-bus: fix boolean return value of "LoadConnections"
The boolean value is intended to indicate success. It would indicated
failure due to a bug.

Fixes: 297d4985ab ('core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API'):
(cherry picked from commit 22e830f046)
(cherry picked from commit e73a505866)
2019-05-10 15:40:06 +02:00
Thomas Haller
8fe900d323 settings: avoid assertion for LoadConnections D-Bus method with relative paths
$ busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager/Settings org.freedesktop.NetworkManager.Settings LoadConnections as 1 relative/filename

triggers a g_critical() assertion in nm_utils_file_is_in_path():

  ...
  #3  0x00007ffff7a19e7d in g_return_if_fail_warning
      (log_domain=log_domain@entry=0x55555586c333 "NetworkManager", pretty_function=pretty_function@entry=0x55555586c0a0 <__FUNCTION__.38585> "nm_utils_file_is_in_path", expression=expression@entry=0x55555586c010 "abs_filename && abs_filename[0] == '/'") at ../glib/gmessages.c:2767
  #4  0x00005555555f1128 in nm_utils_file_is_in_path (abs_filename=abs_filename@entry=0x555555b56670 "dfd", abs_path=<optimized out>) at src/NetworkManagerUtils.c:1077
  #5  0x00005555555a4779 in load_connection (config=<optimized out>, filename=0x555555b56670 "dfd") at src/settings/plugins/keyfile/nms-keyfile-plugin.c:522
  #6  0x00005555557ce291 in nm_settings_plugin_load_connection (self=0x5555559fd400 [NMSKeyfilePlugin], filename=0x555555b56670 "dfd") at src/settings/nm-settings-plugin.c:70
  #7  0x000055555559ccdf in impl_settings_load_connections
      (obj=<optimized out>, interface_info=<optimized out>, method_info=<optimized out>, connection=<optimized out>, sender=<optimized out>, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], parameters=<optimized out>) at src/settings/nm-settings.c:1439
  #8  0x00005555555a9bf9 in dbus_vtable_method_call
      (connection=0x5555559b91b0 [GDBusConnection], sender=sender@entry=0x555555b5c360 ":1.32283", object_path=object_path@entry=0x7fffe0019070 "/org/freedesktop/NetworkManager/Settings", interface_name=<optimized out>, interface_name@entry=0x7fffe002aa70 "org.freedesktop.NetworkManager.Settings", method_name=<optimized out>,
      method_name@entry=0x7fffe00276b0 "LoadConnections", parameters=parameters@entry=0x555555c4a690, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], user_data=0x5555559a1a00)
      at src/nm-dbus-manager.c:947
  #9  0x00007ffff7c506c4 in call_in_idle_cb (user_data=user_data@entry=0x7fffe0015ed0) at ../gio/gdbusconnection.c:4874
  #10 0x00007ffff7a0e8eb in g_idle_dispatch (source=source@entry=0x7fffe00208a0, callback=0x7ffff7c50590 <call_in_idle_cb>, user_data=0x7fffe0015ed0) at ../glib/gmain.c:5627
  #11 0x00007ffff7a11fd0 in g_main_dispatch (context=0x555555994d00) at ../glib/gmain.c:3189
  #12 0x00007ffff7a11fd0 in g_main_context_dispatch (context=context@entry=0x555555994d00) at ../glib/gmain.c:3854
  #13 0x00007ffff7a12368 in g_main_context_iterate (context=0x555555994d00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3927
  #14 0x00007ffff7a126b3 in g_main_loop_run (loop=0x555555995e60) at ../glib/gmain.c:4123
  #15 0x000055555558a741 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:444

Filter out relative filenames early.

(cherry picked from commit a1b102eae4)
(cherry picked from commit c21171e069)
2019-05-10 14:46:25 +02:00
Beniamino Galvani
460124fe71 merge: branch 'bg/restore-ip6-addr-link-up-rh1548237'
https://bugzilla.redhat.com/show_bug.cgi?id=1548237
(cherry picked from commit db46d9b823)
(cherry picked from commit 008a5805bd)
2019-05-08 13:52:16 +02:00
Beniamino Galvani
33a01ab84b device: fix intersecting IPv6 configurations
If the link is down we shouldn't drop the link-local address from
configuration as it wasn't removed by user but by kernel.

(cherry picked from commit 18d2edfaa1)
(cherry picked from commit 6f69144500)
2019-05-08 13:51:52 +02:00
Beniamino Galvani
158dae6b5a device: unconditionally reapply IP configuration on link up
Consider the situation in which ipv4.method=auto and there is an
address configured. Also, the DHCP timeout is long and there is no
DHCP server. If the link is brought down temporarily, the prefix route
for the static address is lost and not restored by NM because we
reapply the IP configuration only when the IP state is DONE.

The same can happen also for IPv6, but in that case also static IPv6
addresses are lost.

We should always reapply the IP configuration when the link goes up.

(cherry picked from commit d0b16b9283)
(cherry picked from commit 4482ca64ba)
2019-05-08 13:51:50 +02:00
Beniamino Galvani
25af9b8f0f all: fix typos (milli seconds -> milliseconds)
(cherry picked from commit 4735d6764a)
(cherry picked from commit f6b9366eb4)
2019-05-08 13:51:49 +02:00
Beniamino Galvani
fc61af9a0a device: fix reapply of MTU
When we set the MTU on the link we remember its previous source
(ip-config, parent-device or connection profile) and don't change it
again afterwards to avoid interfering with user's manual changes. The
only exceptions when we change it again are (1) if the parent device
MTU changes and (2) if the new MTU has higher priority than the one
previously set.

To allow a live reapply of the MTU property we also need to clear the
saved source, or the checks described above will prevent setting the
new value.

Fixes: 2f8917237f ('device: rework mtu priority handling')

https://bugzilla.redhat.com/show_bug.cgi?id=1702657
(cherry picked from commit 4ed72fa658)
(cherry picked from commit e738479bdd)
2019-05-08 13:49:03 +02:00
Beniamino Galvani
b7cd8f283b settings: fix failed assertion
Fix the following assertion failure:

  g_object_ref: assertion 'G_IS_OBJECT (object)' failed.

nm_settings_add_connection() can return a NULL connection.

Fixes: f034f17ff6 ('settings: keep the added connection alive for a bit longer')
(cherry picked from commit 48ce3628c5)
(cherry picked from commit d80818e6ca)
2019-05-08 13:48:17 +02:00
Thomas Haller
764ad1b191 device/wireguard: fix memleak for NMDeviceWireGuard
Fixes: 2148d09482 ('core/wireguard: add support for WireGuard peers')
(cherry picked from commit 56d748eb84)
(cherry picked from commit 5a1818b646)
2019-05-03 11:04:33 +02:00
Thomas Haller
400293d350 platform: fix nm_platform_lnk_gre_to_string() for tap links
Why didn't we get a compiler warning about this bug?
At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:

    CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
  ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                      lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                      ^

Fixes: 4c2862b958 ('platform: add gretap tunnels support')
(cherry picked from commit dfb899f465)
(cherry picked from commit ed88c71f15)
2019-04-18 20:21:22 +02:00
Thomas Haller
8190a68c06 libnm-core/tests: fix "-Werror=logical-not-parentheses" warning in _sock_addr_endpoint()
CC       libnm-core/tests/libnm_core_tests_test_general-test-general.o
  In file included from ../shared/nm-default.h:280:0,
                   from ../libnm-core/tests/test-general.c:24:
  ../libnm-core/tests/test-general.c: In function _sock_addr_endpoint:
  ../libnm-core/tests/test-general.c:5911:18: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
    g_assert (!host == (port == -1));
                    ^
  ../shared/nm-utils/nm-macros-internal.h:1793:7: note: in definition of macro __NM_G_BOOLEAN_EXPR_IMPL
     if (expr) \
         ^
  /usr/include/glib-2.0/glib/gmacros.h:376:43: note: in expansion of macro _G_BOOLEAN_EXPR
   #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1))
                                             ^
  /usr/include/glib-2.0/glib/gtestutils.h:116:49: note: in expansion of macro G_LIKELY
                                                if G_LIKELY (expr) ; else \
                                                   ^
  ../libnm-core/tests/test-general.c:5911:2: note: in expansion of macro g_assert
    g_assert (!host == (port == -1));
    ^

Fixes: 713e879d76 ('libnm: add NMSockAddrEndpoint API')
(cherry picked from commit 1e8c08730f)
(cherry picked from commit fd8b78dd6a)
2019-04-18 09:49:01 +02:00
Piotr Drąg
78e1f975e6 po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/109
2019-04-15 15:39:13 +02:00
Beniamino Galvani
1dfd2e2894 merge: branch 'bg/sanitizers'
Fix build with sanitizers, and other memory fixes

https://github.com/NetworkManager/NetworkManager/pull/342
(cherry picked from commit 549112c1ba)
2019-04-12 11:52:49 +02:00
Beniamino Galvani
ffb12bee18 device: fix memory leak
(cherry picked from commit 82c74eb4e2)
2019-04-12 11:52:27 +02:00
Beniamino Galvani
3924e12752 policy: fix memory leak
(cherry picked from commit ade14408d7)
2019-04-12 11:52:25 +02:00
Beniamino Galvani
3c35fdd058 clients: disable asan leak detection in client tests
Leak detection adds unhelpful messages to the stderr of nmcli, making
tests fail. For example:

 =================================================================
 ==17156==ERROR: LeakSanitizer: detected memory leaks

 Direct leak of 256 byte(s) in 2 object(s) allocated from:
     #0 0x7f08c7e27c88 in realloc (/lib64/libasan.so.5+0xefc88)
     #1 0x7f08c7546e7d in g_realloc (/lib64/libglib-2.0.so.0+0x54e7d)

(cherry picked from commit 2fe9141960)
2019-04-12 11:51:50 +02:00
Beniamino Galvani
68c167bdc3 build: fix build with sanitizers
Add missing linker flags.

(cherry picked from commit 366f9867eb)
2019-04-12 11:38:50 +02:00
Thomas Haller
a94403bb88 build: merge branch 'build-cleanup-and-disable-ebpf'
- make contrib/rpm similar to master.

- make .gitlab-ci.yml similar to master.

- disable eBPF everywhere. Now it must be explicitly disabled.
  It seems to break unit tests on gitlab-ci, with something that
  looks like a kernel issue. Or maybe ulimit -l is so small?
  Anyway, disable it for now as there are problems with it.
2019-04-11 16:41:10 +02:00
Thomas Haller
3443a8004a contrib/rpm: disable eBPF for package builds on Fedora
We have random failures to build on gitlab-ci. Something is wrong,
at least, eBPF is not working reliably. Disable it for now.

(cherry picked from commit 0d16b037f5)
2019-04-11 16:14:35 +02:00
Thomas Haller
9fc91c23ee contrib/rpm: make spec file more similar to rhel-7's
(cherry picked from commit b3997312bf)
2019-04-11 16:14:35 +02:00
Thomas Haller
7bbb6a205f contrib/rpm: from Fedora 31 onwards use internal DHCP client by default
In RHEL-8.0 we already switched the default DHCP plugin.
It's past time that we do the same for Fedora.

(cherry picked from commit b1f556bae2)
2019-04-11 16:14:35 +02:00
Thomas Haller
46dce6e634 contrib/rpm: disable NDEBUG for meson builds
For better or worse, our release builds commonly do not disable assertions.
That means,

 - NDEBUG is not set, and assert() is in effect
 - G_DISABLE_ASSERT is not set, and g_assert() is in effect
 - G_DISABLE_CHECKS is not set, and g_return*() is in effect.

On the other hand, NM_MORE_ASSERTS is not enabled by default and nm_assert()
is stripped away. That is the actual purpose of nm_assert(): it is
commonly disabled on release builds, while all other assertions are
enabled.

Note that it is fully supported to build NetworkManager with all kind of
assertions disabled. However, such a configuration is not much tested
and I would not recommend it for that reason.

%meson expands to

  $ /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled -Db_ndebug=true . x86_64-redhat-linux-gnu $OTHER_ARGS

thus passing -DNDEBUG to the meson build. Override that.

(cherry picked from commit ef338667f8)
2019-04-11 16:14:35 +02:00
Thomas Haller
38ee0c7834 build: disable eBPF by default
We have random failures to build on gitlab-ci. Something is wrong,
at least, eBPF is not working reliably. Disable it for now.

(cherry picked from commit 52ea426b81)
2019-04-11 16:14:35 +02:00
Thomas Haller
114ce3cb81 gitlab-ci: run unit tests for n-acd with eBPF disabled
Enabling eBPF causes src/devices/tests/test-acd to fail:

    strace: bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=8, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0}, 112) = -1 EPERM (Operation not permitted)

    NetworkManager-Message: 10:07:04.404: <warn>  [1554631624.4046] acd[0xa2b400,10]: couldn't init ACD for announcing addresses on interface 'nm-test-veth0': Operation not permitted

Interestingly it does not always fail. Seems to depend on the kernel
which is used in the containerized test environments of gitlab-ci.

For now, just disable eBPF and use the fallback implementation.

(cherry picked from commit a5869d1b35)
2019-04-11 16:14:35 +02:00
Thomas Haller
ed39bf7640 gitlab-ci: add test on Fedora 30 image
And no longer use "fedora:lastest". While "fedora:rawhide" names the very
latest branch (and we want to test that), for all proper releases we want
name them explicitly.

(cherry picked from commit 2955d5e69a)
2019-04-11 16:14:35 +02:00
Thomas Haller
54a525c14f gitlab-ci: print information about test environment in tests
It's just interesting to see in the logs.

(cherry picked from commit 645b195f9c)
2019-04-11 16:14:35 +02:00
Beniamino Galvani
eee2eda4b5 clients: fix assertion when requesting gsm pin secret
[root@gsm-r5s4-01 ~]# nmcli  connection up id gsm
  **
  libnmc:ERROR:clients/common/nm-secret-agent-simple.c:171:_secret_real_new_plain: assertion failed: ((secret_type == NM_SECRET_AGENT_SECRET_TYPE_SECRET) == nm_setting_get_secret_flags (setting, property, ((void *)0), ((void *)0)))
  Aborted (core dumped)

The pin is a secret property.

https://bugzilla.redhat.com/show_bug.cgi?id=1698495
(cherry picked from commit a94ccc9acc)
2019-04-11 13:54:54 +02:00
Thomas Haller
ce6b7cc824 connectivity: fix build with --disable-concheck
Fixes: 2cec94bacc ('connectivity: use systemd-resolved for resolving the check endpoint')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/155
(cherry picked from commit 8aefac804c)
2019-04-10 21:26:20 +02:00
Beniamino Galvani
43571d1013 team: clean up state when connection to teamd fails
If NM fails to connect to teamd, it currently just sets the device
state to FAILED and waits that deactivate() is called later. However,
the 5 seconds timeout on teamd process start can hit in the meantime,
which fails with an assertion "nm_device_is_activating (device)".

Clean up the device state when the connection to teamd fails.

https://bugzilla.redhat.com/show_bug.cgi?id=1697900
(cherry picked from commit c48698d747)
2019-04-10 08:46:18 +02:00
Beniamino Galvani
3fa39f6112 libnm-core: fix invalid memory access
When we delete the runner.name property, the runner object itself gets
deleted if that was the only property, and @runner becomes invalid.

 ==13818== Invalid read of size 1
 ==13818==    at 0x55EAF4: nm_streq (nm-macros-internal.h:869)
 ==13818==    by 0x55EAF4: _json_team_normalize_defaults (nm-utils.c:5573)
 ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
 ==13818==  Address 0x182a9330 is 0 bytes inside a block of size 13 free'd
 ==13818==    at 0x4839A0C: free (vg_replace_malloc.c:530)
 ==13818==    by 0x4857868: json_delete_string (value.c:763)
 ==13818==    by 0x4857868: json_delete (value.c:975)
 ==13818==    by 0x4851FA1: UnknownInlinedFun (jansson.h:129)
 ==13818==    by 0x4851FA1: hashtable_do_del (hashtable.c:131)
 ==13818==    by 0x4851FA1: hashtable_del (hashtable.c:289)
 ==13818==    by 0x55DFDD: _json_del_object (nm-utils.c:5384)
 ==13818==    by 0x55EA70: _json_delete_object_on_string_match (nm-utils.c:5532)
 ==13818==    by 0x55EADB: _json_team_normalize_defaults (nm-utils.c:5549)
 ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
 ==13818==  Block was alloc'd at
 ==13818==    at 0x483880B: malloc (vg_replace_malloc.c:299)
 ==13818==    by 0x4852E8C: lex_scan_string (load.c:389)
 ==13818==    by 0x4852E8C: lex_scan (load.c:620)
 ==13818==    by 0x4853458: parse_object (load.c:738)
 ==13818==    by 0x4853458: parse_value (load.c:862)
 ==13818==    by 0x4853466: parse_object (load.c:739)
 ==13818==    by 0x4853466: parse_value (load.c:862)
 ==13818==    by 0x4853655: parse_json.constprop.7 (load.c:899)
 ==13818==    by 0x48537CF: json_loads (load.c:959)
 ==13818==    by 0x566780: _nm_utils_team_config_set (nm-utils.c:5961)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)

Fixes: a5642fd93a ('libnm-core: team: rework defaults management on runner properties')
(cherry picked from commit 80a3031a7c)
2019-04-09 09:46:21 +02:00
Yupeng Chang
00858afc4f ifupdown: fix connection iterator
Fixes: 6aa66426a4 ('settings/ifupdown: merge eni_ifaces and connections hashes in plugin')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/145
https://bugzilla.redhat.com/show_bug.cgi?id=1694912
(cherry picked from commit 1dd67583e3)
2019-04-02 11:36:45 +02:00
Beniamino Galvani
fed4694f9b clients: only ask secrets for settings that require them
When nmcli needs secrets for a connection it asks them for every known
setting. nmtui is a bit smarter and asks them only for settings that
actually exist in the connection. Make a step further and let clients
ask secrets only for setting that exist *and* have any secret
property. This decreases the number of D-Bus calls when editing or
showing a connection with secrets.

https://bugzilla.redhat.com/show_bug.cgi?id=1506536
https://github.com/NetworkManager/NetworkManager/pull/327
(cherry picked from commit 5b5a768b69)
2019-04-02 11:21:25 +02:00
Beniamino Galvani
1fa0914b17 build: fix searching dlopen in configure
The 4th argument of AC_SEARCH_LIBS is a list of additional libraries,
not the name of the variable to hold the result which is always
ac_cv_search_$function. Also, we should ignore the result when it is
"none required".

Fixes: 1f2eeb85d8 ('build: rename $(LIBDL) to $(DL_LIBS) and modify detection')
(cherry picked from commit bd4957fcd7)
2019-03-31 12:04:20 +02:00
Lubomir Rintel
8ec0954570 ovs: don't traverse interface through disconnected when the ovsdb entry is removed
Go straight to unmanaged. That's what all the other devices do when
their backing resources vanish. If the device reached disconnected
state, an autoconnect check would try to connect it back, in vain.

https://github.com/NetworkManager/NetworkManager/pull/324
(cherry picked from commit 045b88a5b5)
2019-03-29 00:03:11 +01:00
Lubomir Rintel
015ef82e1b ovs-interface: dissociate the link on disconnection
Open vSwitch is the special kid on the block -- it likes to be in charge of
the link lifetime and so we shouldn't be. This means that we shouldn't be
attempting to remove the link: we'd just (gracefully) fail anyways.

More importantly, this also means that we shouldn't care if we see the link
go away. Once the device reaches DISCONNECTED state, its configuration is
cleaned up and we may already be activating another connection. We shouldn't
alter the device state when OpenVSwitch decides to drop the old link.

https://bugzilla.redhat.com/show_bug.cgi?id=1543557
https://github.com/NetworkManager/NetworkManager/pull/324
(cherry picked from commit 3a55ec63e1)
2019-03-29 00:03:05 +01:00
Lubomir Rintel
ebdc37e32e settings: keep the added connection alive for a bit longer
Fixes a crash on failed AddAndActivate:

  $ ip link set eth0 down
  $ nmcli d conn eth0
  Error: Failed to add/activate new connection: Connection 'eth0' is not available on device eth0 because device has no carrier
  <NetworkManager crashes>

  #3  0x000055555558b6c5 in _nm_g_return_if_fail_warning
  #4  0x00005555557008c7 in nm_settings_has_connection
  #5  0x0000555555700e5f in pk_add_cb
  #6  0x0000555555726e30 in pk_call_cb
  #7  0x0000555555726e30 in pk_call_cb
  #8  0x0000555555726e30 in pk_call_cb
  #9  0x00005555555aaea8 in _call_id_invoke_callback
  #10 0x00005555555ab2e8 in _call_on_idle

https://github.com/NetworkManager/NetworkManager/pull/325
(cherry picked from commit f034f17ff6)
2019-03-29 00:02:55 +01:00
Lubomir Rintel
b4359e5700 device: fix the slave state change reason on master connection removal
If we surprise-remove the master, slaves would immediately attempt to bring
things up by autoconnecting. Not cool. Policy, however, blocks
autoconnect if the slaves disconnect due to "dependency-failed", and it
indeed seems to be an appropriate reason here:

  $ nmcli c add type bridge
  $ nmcli c add type dummy ifname dummy0 master bridge autoconnect yes
  $ nmcli c del bridge
  $

Before:

  (nm-bridge): state change: ip-config -> deactivating (reason 'connection-removed')
  (nm-bridge): state change: deactivating -> disconnected (reason 'connection-removed')
  (nm-bridge): detached bridge port dummy0
  (dummy0): state change: activated -> disconnected (reason 'connection-removed')
  (nm-bridge): state change: disconnected -> unmanaged (reason 'user-requested')
  (dummy0): state change: disconnected -> unmanaged (reason 'user-requested')
  policy: auto-activating connection 'bridge-slave-dummy0'

After:

  (nm-bridge): state change: ip-config -> deactivating (reason 'connection-removed')
  (nm-bridge): state change: deactivating -> disconnected (reason 'connection-removed')
  (nm-bridge): detached bridge port dummy0
  (dummy0): state change: activated -> deactivating (reason 'dependency-failed')
  (nm-bridge): state change: disconnected -> unmanaged (reason 'user-requested')
  (dummy0): state change: deactivating -> disconnected (reason 'dependency-failed')
  (dummy0): state change: disconnected -> unmanaged (reason 'user-requested')

https://github.com/NetworkManager/NetworkManager/pull/319
(cherry picked from commit 8f2a8a52f0)
2019-03-29 00:02:48 +01:00
Beniamino Galvani
065fa28373 dns: fix memory leak of error
The error was leaked when cancelled.

Fixes: 818023c257 ('dns/resolved: add systemd-resolved backend')
(cherry picked from commit 579373a5df)
2019-03-26 17:39:46 +01:00
Thomas Haller
5e66dcc6ee contrib/checkpatch: avoid command injection in checkpatch.pl script
The capture variables, $1, etc, are not valid unless the match
succeeded, and they're not cleared, either.

    $ git checkout -B C origin/master && \
        echo XXXXX > f.txt && \
        git add f.txt && \
        git commit -m 'this commit does something()'
    Branch 'C' set up to track remote branch 'master' from 'origin'.
    Reset branch 'C'
    Your branch is up to date with 'origin/master'.
    sh: -c: line 0: syntax error near unexpected token `('
    sh: -c: line 0: `git log --abbrev=12 --pretty=format:"%h ('%s')" -1 does something() 2>/dev/null'

    >>> VALIDATE "a169a98e14 this commit does something()"
    (commit message):4: Commit 'does something()' does not seem to exist:
    > Subject: [PATCH] this commit does something()

    (commit message):4: Refer to the commit id properly: :
    > Subject: [PATCH] this commit does something()

    The patch does not validate.

(cherry picked from commit d66a1ace23)
2019-03-19 16:25:20 +01:00
Thomas Haller
63b2201302 release: bump version to 1.16.1 (development) 2019-03-15 16:16:10 +01:00
Thomas Haller
15a6b41239 release: bump version to 1.16.0 2019-03-15 16:15:04 +01:00
Thomas Haller
960f9fe937 release: update NEWS 2019-03-15 16:12:06 +01:00
Thomas Haller
e1ef6c0b26 device/wifi: fix handling static WEP connections in act_stage4_ip_config_timeout()
Fixes: 5e71f01605 ('device: merge stage3 and stage4 ip-config function for IPv4 and IPv6')
(cherry picked from commit fd2106dbd6)
2019-03-15 16:02:15 +01:00
Beniamino Galvani
47f1c931ee libnm: fix dns-configuration property type
Fixes: a8d6005256 ('libnm: implement support for DNS manager properties')

https://bugzilla.redhat.com/show_bug.cgi?id=1689055
(cherry picked from commit d867837d05)
2019-03-15 11:15:37 +01:00
Thomas Haller
b38fbab080 libnm-core: fix types of nm_auto() macros for NMSockAddrEndpoint and NMWireGuardPeer
(cherry picked from commit b24f0a46ae)
2019-03-13 20:25:57 +01:00
Thomas Haller
f90c663d51 libnm-core: fix type of argument for nm_utils_inet_ntop_dup()
Fixes: 898f7a5665 ('libnm: add internal API nm_utils_inet*_ntop_dup()')
(cherry picked from commit a0d0d4d770)
2019-03-13 20:25:47 +01:00
Thomas Haller
cfb970b277 shared/systemd: fix gettid() compat implementation shadowing function from glibc
On Fedora rawhide we get the following build failure:

    In file included from shared/systemd/src/basic/alloc-util.c:3:
    ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:114:21: error: static declaration of 'gettid' follows non-static declaration
      114 | static inline pid_t gettid(void) {
          |                     ^~~~~~
    In file included from /usr/include/unistd.h:1170,
                     from /usr/include/glib-2.0/gio/gcredentials.h:32,
                     from /usr/include/glib-2.0/gio/gio.h:46,
                     from ./shared/nm-utils/nm-macros-internal.h:31,
                     from ./shared/nm-default.h:293,
                     from ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:22,
                     from shared/systemd/src/basic/alloc-util.c:3:
    /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
       34 | extern __pid_t gettid (void) __THROW;
          |                ^~~~~~

glibc supports now gettid() call ([1]) which conflicts with our compat
implementation. Rename it.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92

(cherry picked from commit 10276322bd)
2019-03-11 19:09:59 +01:00
Thomas Haller
96be30cbcc release: bump version to 1.15.91 (1.16-rc2) 2019-03-11 16:50:17 +01:00
Thomas Haller
9294b42ba0 ifcfg-rh: avoid duplicate cache lookup in is_wifi_device()
(cherry picked from commit 6580f2931d)
2019-03-11 16:44:59 +01:00