summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* n-dhcp4: use packet socket in rebinding statebg/nettools-rebootBeniamino Galvani2019-12-202-3/+30
| | | | | | | After t1, the client tries to renew the lease by contacting via the udp socket the server specified in the server-id option. If this fails, after t2 it tries to contact any server using broadcast. For this to work, the packet socket must be used.
* dhcp: nettools: fix parsing of classless routes optionBeniamino Galvani2019-12-201-1/+4
| | | | Fixes: 6adade6f21d5 ('dhcp: add nettools dhcp4 client')
* n-dhcp4: fix logging broadcast messagesBeniamino Galvani2019-12-201-0/+7
| | | | | Log the broadcast address instead of the server IP as destination when needed.
* n-dhcp4: support init-reboot stateBeniamino Galvani2019-12-204-8/+83
| | | | | | | | | | Currently the client always starts from the INIT state (i.e. sending a discover message). If a requested-ip was specified by the caller, it is added as an option in the discover. The RFC allows to skip the discover by entering the INIT-REBOOT state and start directly with a broadcast request message containing the requested IP address. Implement that.
* dhcp: test parsing of domain-search optionBeniamino Galvani2019-12-203-14/+94
| | | | Add a test for the parsing of the the domain-search option.
* libnm: emit property changed signal when setting NM_CLIENT_DBUS_CONNECTIONThomas Haller2019-12-181-0/+2
|
* Merge branch 'ac/readline_fix_leaks'Antonio Cardace2019-12-183-15/+22
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/366
| * clients,libnm-core: zero-out memory used to store plain-text secretsAntonio Cardace2019-12-183-14/+17
| |
| * common: readline: fix memory leak of plain text secretAntonio Cardace2019-12-181-1/+5
|/ | | | | | | | After a user entered a secret it would get stored in the readline history data structure (in plain text) and eventually get leaked. This commit instructs readline to not store any secret in its history and fixes a non-related memory leak.
* dhcp: nettools: check return value of g_file_set_contents()Beniamino Galvani2019-12-181-6/+8
| | | | | | | | | | Found by covscan: NetworkManager-1.22.0/src/dhcp/nm-dhcp-nettools.c:945: check_return: Calling "g_file_set_contents" without checking return value (as is done elsewhere 16 out of 20 times). Fixes: 9f8951692822 ('dhcp: nettools: read/write lease files')
* shared: add missing va_end() to _nm_dbus_error_is()Beniamino Galvani2019-12-181-1/+3
| | | | | | | | | Found by covscan: NetworkManager-1.22.0/shared/nm-glib-aux/nm-dbus-aux.c:361: missing_va_end: va_end was not called for "ap". Fixes: ce36494c0a48 ('shared: add nm_dbus_error_is() helper')
* dhcp: nettools: fix parsing of search domains optionBeniamino Galvani2019-12-171-2/+2
| | | | | | | | 'first' was never modified and so the dot was never added. Fixes: 6adade6f21d5 ('dhcp: add nettools dhcp4 client') https://bugzilla.redhat.com/show_bug.cgi?id=1783981
* release: bump version to 1.23.1-dev after 1.22.0 release1.23.1-devThomas Haller2019-12-17129-1450/+3499
|\ | | | | | | | | | | | | | | | | | | After 1.22.0 is released, merge it back into master so that 1.22.0 is part of the history of master. That means, $ git log --first-parent master will also traverse 1.22.0 and 1.22-rc*. Also bump the micro version to 1.23.1-dev to indicate that this is after 1.22.0 is out.
| * libnm/secret-agent: remove unused variableThomas Haller2019-12-171-1/+0
| | | | | | | | Fixes: f0d3243f2ba9 ('libnm/secret-agent: fix race registering secret agent')
| * libnm/secret-agent: fix reseting timeout when registration completesThomas Haller2019-12-161-2/+1
| | | | | | | | Fixes: f0d3243f2ba9 ('libnm/secret-agent: fix race registering secret agent')
| * libnm: merge branch 'th/secret-agent-register-race'Thomas Haller2019-12-165-180/+353
| |\ | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1781084 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/364
| | * libnm/secret-agent: fix race registering secret agentThomas Haller2019-12-161-32/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When NetworkManager starts, NMSecretAgentOld gets a name-owner changed signal and registers right away. Especially since commit ce0e898fb476 ('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
| | * libnm/secret-agent: use GTask for nm_secret_agent_old_register*()Thomas Haller2019-12-161-55/+31
| | | | | | | | | | | | | | | 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.
| | * libnm/secret-agent: support debug logging from secret-agentThomas Haller2019-12-161-1/+21
| | |
| | * libnm/secret-agent: drop fallback to Register() method for secret-agentThomas Haller2019-12-161-68/+29
| | | | | | | | | | | | | | | | | | 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).
| | * libnm: allow using _LOGx() macros in libnmThomas Haller2019-12-161-0/+13
| | |
| | * shared: implement _LOGx() macros using log levels that are themself definesThomas Haller2019-12-161-63/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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.
| | * shared: add nm_dbus_error_is() helperThomas Haller2019-12-162-0/+36
| |/
| * all: fix wrong "gs_free GError *" declarationsThomas Haller2019-12-164-6/+6
| | | | | | | | This is a bug and leads either to a leak or a crash.
| * checkpatch: catch "gs_free GError *" declationsThomas Haller2019-12-161-0/+1
| |
| * systemd: merge branch systemd into masterThomas Haller2019-12-1631-109/+1601
| |\
| | * systemd: update code from upstream (2019-12-13)Thomas Haller2019-12-1521-102/+1514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=c8bf87b3399a3dd0b17fd0003b9797635b161ee0 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files -z :/src/systemd/src/ \ :/shared/systemd/src/ \ :/shared/nm-std-aux/unaligned.h | \ xargs -0 rm -f nm_copy_sd_shared() { mkdir -p "./shared/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./shared/systemd/$1" } nm_copy_sd_core() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_stdaux() { mkdir -p "./shared/nm-std-aux/" cp "$SYSTEMD_DIR/$1" "./shared/nm-std-aux/${1##*/}" } nm_copy_sd_core "src/libsystemd-network/arp-util.c" nm_copy_sd_core "src/libsystemd-network/arp-util.h" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c" nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd_core "src/libsystemd-network/lldp-internal.h" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd_core "src/libsystemd-network/lldp-network.c" nm_copy_sd_core "src/libsystemd-network/lldp-network.h" nm_copy_sd_core "src/libsystemd-network/network-internal.c" nm_copy_sd_core "src/libsystemd-network/network-internal.h" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd_core "src/libsystemd-network/sd-lldp.c" nm_copy_sd_core "src/libsystemd/sd-event/event-source.h" nm_copy_sd_core "src/libsystemd/sd-event/event-util.c" nm_copy_sd_core "src/libsystemd/sd-event/event-util.h" nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd_core "src/systemd/_sd-common.h" nm_copy_sd_core "src/systemd/sd-dhcp-client.h" nm_copy_sd_core "src/systemd/sd-dhcp-lease.h" nm_copy_sd_core "src/systemd/sd-dhcp-option.h" nm_copy_sd_core "src/systemd/sd-dhcp6-client.h" nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h" nm_copy_sd_core "src/systemd/sd-event.h" nm_copy_sd_core "src/systemd/sd-id128.h" nm_copy_sd_core "src/systemd/sd-ipv4acd.h" nm_copy_sd_core "src/systemd/sd-ipv4ll.h" nm_copy_sd_core "src/systemd/sd-lldp.h" nm_copy_sd_core "src/systemd/sd-ndisc.h" nm_copy_sd_shared "src/basic/alloc-util.c" nm_copy_sd_shared "src/basic/alloc-util.h" nm_copy_sd_shared "src/basic/async.h" nm_copy_sd_shared "src/basic/env-file.c" nm_copy_sd_shared "src/basic/env-file.h" nm_copy_sd_shared "src/basic/env-util.c" nm_copy_sd_shared "src/basic/env-util.h" nm_copy_sd_shared "src/basic/errno-util.h" nm_copy_sd_shared "src/basic/escape.c" nm_copy_sd_shared "src/basic/escape.h" nm_copy_sd_shared "src/basic/ether-addr-util.c" nm_copy_sd_shared "src/basic/ether-addr-util.h" nm_copy_sd_shared "src/basic/extract-word.c" nm_copy_sd_shared "src/basic/extract-word.h" nm_copy_sd_shared "src/basic/fd-util.c" nm_copy_sd_shared "src/basic/fd-util.h" nm_copy_sd_shared "src/basic/fileio.c" nm_copy_sd_shared "src/basic/fileio.h" nm_copy_sd_shared "src/basic/format-util.c" nm_copy_sd_shared "src/basic/format-util.h" nm_copy_sd_shared "src/basic/fs-util.c" nm_copy_sd_shared "src/basic/fs-util.h" nm_copy_sd_shared "src/basic/hash-funcs.c" nm_copy_sd_shared "src/basic/hash-funcs.h" nm_copy_sd_shared "src/basic/hashmap.c" nm_copy_sd_shared "src/basic/hashmap.h" nm_copy_sd_shared "src/basic/hexdecoct.c" nm_copy_sd_shared "src/basic/hexdecoct.h" nm_copy_sd_shared "src/basic/hostname-util.c" nm_copy_sd_shared "src/basic/hostname-util.h" nm_copy_sd_shared "src/basic/in-addr-util.c" nm_copy_sd_shared "src/basic/in-addr-util.h" nm_copy_sd_shared "src/basic/io-util.c" nm_copy_sd_shared "src/basic/io-util.h" nm_copy_sd_shared "src/basic/list.h" nm_copy_sd_shared "src/basic/log.h" nm_copy_sd_shared "src/basic/macro.h" nm_copy_sd_shared "src/basic/memory-util.c" nm_copy_sd_shared "src/basic/memory-util.h" nm_copy_sd_shared "src/basic/mempool.c" nm_copy_sd_shared "src/basic/mempool.h" nm_copy_sd_shared "src/basic/missing_fcntl.h" nm_copy_sd_shared "src/basic/missing_random.h" nm_copy_sd_shared "src/basic/missing_socket.h" nm_copy_sd_shared "src/basic/missing_stat.h" nm_copy_sd_shared "src/basic/missing_syscall.h" nm_copy_sd_shared "src/basic/missing_type.h" nm_copy_sd_shared "src/basic/parse-util.c" nm_copy_sd_shared "src/basic/parse-util.h" nm_copy_sd_shared "src/basic/path-util.c" nm_copy_sd_shared "src/basic/path-util.h" nm_copy_sd_shared "src/basic/prioq.c" nm_copy_sd_shared "src/basic/prioq.h" nm_copy_sd_shared "src/basic/process-util.c" nm_copy_sd_shared "src/basic/process-util.h" nm_copy_sd_shared "src/basic/random-util.c" nm_copy_sd_shared "src/basic/random-util.h" nm_copy_sd_shared "src/basic/set.h" nm_copy_sd_shared "src/basic/signal-util.c" nm_copy_sd_shared "src/basic/signal-util.h" nm_copy_sd_shared "src/basic/siphash24.h" nm_copy_sd_shared "src/basic/socket-util.c" nm_copy_sd_shared "src/basic/socket-util.h" nm_copy_sd_shared "src/basic/sort-util.h" nm_copy_sd_shared "src/basic/sparse-endian.h" nm_copy_sd_shared "src/basic/stat-util.c" nm_copy_sd_shared "src/basic/stat-util.h" nm_copy_sd_shared "src/basic/stdio-util.h" nm_copy_sd_shared "src/basic/string-table.c" nm_copy_sd_shared "src/basic/string-table.h" nm_copy_sd_shared "src/basic/string-util.c" nm_copy_sd_shared "src/basic/string-util.h" nm_copy_sd_shared "src/basic/strv.c" nm_copy_sd_shared "src/basic/strv.h" nm_copy_sd_shared "src/basic/strxcpyx.c" nm_copy_sd_shared "src/basic/strxcpyx.h" nm_copy_sd_shared "src/basic/time-util.c" nm_copy_sd_shared "src/basic/time-util.h" nm_copy_sd_shared "src/basic/tmpfile-util.c" nm_copy_sd_shared "src/basic/tmpfile-util.h" nm_copy_sd_shared "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/utf8.c" nm_copy_sd_shared "src/basic/utf8.h" nm_copy_sd_shared "src/basic/util.c" nm_copy_sd_shared "src/basic/util.h" nm_copy_sd_shared "src/shared/dns-domain.c" nm_copy_sd_shared "src/shared/dns-domain.h" nm_copy_sd_stdaux "src/basic/unaligned.h"
| * | client: fallback to CLOCK_MONOTONIC for timerfdThomas Haller2019-12-152-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | manager: create a virtual device only if the connection can autoconnectBeniamino Galvani2019-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | device: don't reapply IP configuration if the ifindex is missingBeniamino Galvani2019-12-141-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * | ovs: check state before starting ip configuration after link changeBeniamino Galvani2019-12-141-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | all: rename time related function to spell out nsec/usec/msec/secThomas Haller2019-12-1348-281/+286
| | | | | | | | | | | | | | | | | | The abbreviations "ns" and "ms" seem not very clear to me. Spell them out to nsec/msec. Also, in parts we already used the longer abbreviations, so it wasn't consistent.
| * | cloud-setup/trivial: rename timeout_ms to timeout_msecThomas Haller2019-12-134-13/+13
| | | | | | | | | | | | | | | I think "ms" as abbreviation is too short and unclear. Also, it's not used consistently. Rename variable.
| * | meson/build: avoid using ternary as it breaks older mesonThomas Haller2019-12-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: c21c6bc0be2a ('build/meson: allow configuring default for main.auth-polkit setting')
| * | shared/glib: reimplement g_atomic_pointer_compare_and_exchange() macroThomas Haller2019-12-131-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | clients/tests: merge branch 'th/clients-test-select-fields'Thomas Haller2019-12-132-889/+2249
| |\ \
| | * | clients/tests: add test for selecting fields from multiple connections with ↵Thomas Haller2019-12-132-818/+2153
| | | | | | | | | | | | | | | | `nmcli con show`
| | * | clients/tests: support Util.replace_text_sort_list() helperThomas Haller2019-12-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | clients/tests: add NMStubServer.findConnections() helper functionThomas Haller2019-12-131-5/+9
| | | | | | | | | | | | | | | | Will be used to get all connection from the test stub server.
| | * | clients/tests: support replacing UUIDs in command textThomas Haller2019-12-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | clients/tests: fix wrongly constructing command line string as tuple in ↵Thomas Haller2019-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | TestNmcli It had no bad effect, but the cmd was a tuple with one string, and not a string.
| | * | clients/tests: support string arguments to Util.replace_text()Thomas Haller2019-12-131-1/+8
| | | |
| | * | clients/tests: rename "replace_stdout" variable to "replace_uuids"Thomas Haller2019-12-131-64/+64
| |/ / | | | | | | | | | | | | | | | 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.
| * | nm-manager: restore passing correct size to sendfile in copy_lease()Alexey Kodanev2019-12-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise sendfile() fails with EINVAL when the file offset is greater than zero (pos + size > max), always on the second iteration. Fixes: 0c6cd07ec81d ('nm-manager: remove lease file if copying dhclient lease fails') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/359
| * | manager: forbid autoactivation of parent when it is blocked by user requestbg/parent-autoactivate-rh1765566Beniamino Galvani2019-12-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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
| * | merge: branch 'bg/mtu-reapply-rh1779162'Beniamino Galvani2019-12-112-0/+35
| |\ \ | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1779162 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/356
| | * | device: always allow reapply of MTU from wired settingBeniamino Galvani2019-12-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | infiniband: allow reapply of MTUBeniamino Galvani2019-12-111-0/+27
| |/ /
| * | core/auth: merge branch 'th/polkit-root-only'Thomas Haller2019-12-1112-64/+202
| |\ \ | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1762011 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/357
| | * | config: print config warnings during `NetworkManager --print-config`Thomas Haller2019-12-111-0/+8
| | | |