Commit Graph

30872 Commits

Author SHA1 Message Date
Fernando Fernandez Mancera
4655b7c308 veth: fix veth activation on booting
When creating one profile for each veth during activation the creation
of the veth could fail. When the link for the first profile is created
the link for the peer is generated in kernel. Therefore when trying to
activate the second profile it will fail because the link already
exists. NetworkManager must check if the link already exists and
corresponds to the same veth, if so, it should skip the link creation.

https://bugzilla.redhat.com/show_bug.cgi?id=2036023
https://bugzilla.redhat.com/show_bug.cgi?id=2105956
2022-07-12 13:34:18 +02:00
Beniamino Galvani
1784fc9fa1 core: update DNS when the device enters IP_CONFIG state
Update DNS information when the device enters the IP_CONFIG state. In
this way, when dispatcher events "dhcp4-change,dhcp6-change" are
emitted resolv.conf already contains the information received from
the DHCP lease.

https://bugzilla.redhat.com/show_bug.cgi?id=2100456
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1283
2022-07-11 15:51:37 +02:00
Beniamino Galvani
2504a72ec0 initrd: set a default carrier timeout of 10 seconds in initrd
In initrd, a too short carrier timeout means that the machine will
possibly fail to boot. On the other hand, increasing the value doesn't
have side effects, except for a bit longer delay on some machines.

Increase the value to 10 seconds. Note that the default value is not
propagated to the real root.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1239
2022-07-11 15:47:40 +02:00
Lubomir Rintel
8d12cc8152 contrib/rpm: untangle setting of bcond_{test,debug} defaults
Resolve the defaults in build.sh instead of RPM macros. This looks less
terrible maintaining the same defaults as well as options to override it
upstream.

Moving it to the block that downstreams (Fedora, Red Hat) keep
customized makes it possible for them to also maintain customized
defaults here.

In particular, the downstreams should be able to enable bcond_test
at least for their production release (otherwise there's little point in
actually running tests at package build time).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1286
2022-07-10 20:49:05 +02:00
Lubomir Rintel
880bec0f4f release: bump version to 1.39.9 (development) 2022-07-07 14:53:15 +02:00
Thomas Haller
556bff1767 systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1291
2022-07-07 00:50:46 +02:00
Thomas Haller
b12281089c gitlab-ci: fix unit tests on centos7 for python-pexpect dependency
Fixes: 9570224e86 ('tests/client: add a pexpect-based test runner')
2022-07-06 18:36:52 +02:00
Thomas Haller
8dff528195 clang-format: merge branch 'th/gitlab-ci-update'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1242
2022-07-06 11:09:28 +02:00
Thomas Haller
b428de6916 add reformatting commit to ".git-blame-ignore-revs" 2022-07-06 11:08:23 +02:00
Thomas Haller
d8a4b3bec2 all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update gitlab-ci to f36 2022-07-06 11:06:53 +02:00
Thomas Haller
30d89a121d contrib: fix "nm-python-black-format.sh" script to ignore systemd,c-util,nettools files
Otherwise, the path "src/c-stdaux/src/docs/conf.py" matches for
formatting. But this file is imported via git-subtree, we don't
want to format it.

Filter out such paths.
2022-07-06 10:44:18 +02:00
Thomas Haller
42a70ce1d9 c-stdaux: re-import git-subtree for 'src/c-stdaux'
git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
2022-07-06 10:16:01 +02:00
Thomas Haller
9d1772bd73 Squashed 'src/c-stdaux/' changes from 99fe83cd5698..1407a1fb2754
1407a1fb2754 ci: add clang to RTD scripts
8404c4ca6d06 ci: build documentation
044c65c2e134 docs: add sphinx-based API documentation
ad8449068d96 ci: use ci-c-util for macos runs
179987035687 build: adjust for v1.1.0 release
55d787178c84 build: prepare v1.1.0 release
29ca943e636a c-stdaux: avoid NULL arithmetic even in dead-code
c6358e956c29 c-stdaux: avoid NULL-dereference in constant expressions
7fab258bdf6a c-stdaux: improve kerneldoc comments
434b75a796c0 build: export 'version-scripts' configuration
33d56a6aecb9 c-stdaux: encapsulate C_EXPR_ASSERT()
aca7ee0ece60 ci: add macos run
0aa338b1f0de test: prefer pipe() over eventfd() for portability
adda5ff3e9d9 build: export cflags via pkg-config
7a8493bebc59 api: add c_memcpy()
a01615aefe48 build: prepare v1.0.0
1685fc39db3d api: provide c_memzero()
1257244f886a api: add c_memset()

git-subtree-dir: src/c-stdaux
git-subtree-split: 1407a1fb275494f9efc1abbef2fd19856fb1f43d
2022-07-06 10:15:51 +02:00
Thomas Haller
18f14d044d c-siphash: re-import git-subtree for 'src/c-siphash'
git subtree pull --prefix src/c-siphash git@github.com:c-util/c-siphash.git main --squash
2022-07-06 10:14:28 +02:00
Thomas Haller
f852f532b0 Squashed 'src/c-siphash/' changes from 1da8a0d46bfd..04187aa367ee
04187aa367ee build: prepare v1.0.0 release
0e41909e19e1 build: use libcstdaux.version-scripts
203347c4d3e4 build: drop --no-undefined

git-subtree-dir: src/c-siphash
git-subtree-split: 04187aa367ee24dcbfb23678558b6efa31fd6511
2022-07-06 10:13:02 +02:00
Thomas Haller
8fdcd7030c c-rbtree: re-import git-subtree for 'src/c-rbtree'
git subtree pull --prefix src/c-rbtree git@github.com:c-util/c-rbtree.git main --squash
2022-07-06 10:07:14 +02:00
Thomas Haller
49f854886e Squashed 'src/c-rbtree/' changes from eb778d39694a..e56535a5daa5
e56535a5daa5 c-rbtree: add overview comments
e1187dd4f56c c-rbtree: improve doc-strings
5c58005f4352 build: bump version
becd70d97145 build: prepare v3.1.0 release
1d865e41b95f build: use libcstdaux.version-scripts
2d4fccbc0095 build: synchronize AUTHORS
b6af0681629a meson: no longer pass -Wl,--no-undefined explicitly
7995758e8540 ci: run on macos

git-subtree-dir: src/c-rbtree
git-subtree-split: e56535a5daa598f329ad05ffb9a9f38585496f34
2022-07-06 10:06:23 +02:00
Thomas Haller
7d2bf498ca c-list: re-import git-subtree for 'src/c-list'
git subtree pull --prefix src/c-list git@github.com:c-util/c-list.git main --squash
2022-07-06 10:04:09 +02:00
Thomas Haller
130ac3e3a9 Squashed 'src/c-list/' changes from b86ba656ac22..fa024740fc6f
fa024740fc6f build: prepare v3.1.0 release

git-subtree-dir: src/c-list
git-subtree-split: fa024740fc6f0e244afb3eed888f95bffdf36323
2022-07-06 09:45:34 +02:00
Thomas Haller
b3181cfbee example: add python example for libnm, NMClient, GMainContext and async
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1290
2022-07-05 18:36:01 +02:00
Thomas Haller
1c9bc85d0c gitignore: ignore m4/gettext artifacts 2022-07-05 18:31:37 +02:00
Thomas Haller
3a603c8764 systemd: update code from upstream (2022-07-05)
This is a direct dump from systemd git.

  $ git clean -fdx && \
    git cat-file -p HEAD | sed '1,/^======$/ d' | bash - && \
    git add .

======

SYSTEMD_DIR=../systemd
COMMIT=87a3a4a802b9fcfd92299e2984741835ed50fef4

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files -z :/src/libnm-systemd-core/src/ \
                :/src/libnm-systemd-shared/src/ \
                :/src/libnm-std-aux/unaligned.h | \
  xargs -0 rm -f

nm_copy_sd_shared() {
    mkdir -p "./src/libnm-systemd-shared/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-shared/$1"
}

nm_copy_sd_core() {
    mkdir -p "./src/libnm-systemd-core/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-core/$1"
}

nm_copy_sd_stdaux() {
    mkdir -p "./src/libnm-std-aux/"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-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-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-option.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.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/lldp-rx-internal.h"
nm_copy_sd_core "src/libsystemd-network/network-common.c"
nm_copy_sd_core "src/libsystemd-network/network-common.h"
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-dhcp6-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd_core "src/libsystemd-network/sd-lldp-rx.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-dhcp6-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-option.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-lldp-rx.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/cgroup-util.h"
nm_copy_sd_shared "src/basic/dns-def.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/glyph-util.c"
nm_copy_sd_shared "src/basic/glyph-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/inotify-util.c"
nm_copy_sd_shared "src/basic/inotify-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/locale-util.c"
nm_copy_sd_shared "src/basic/locale-util.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/ordered-set.c"
nm_copy_sd_shared "src/basic/ordered-set.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/ratelimit.c"
nm_copy_sd_shared "src/basic/ratelimit.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/user-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/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/sha256.c"
nm_copy_sd_shared "src/fundamental/sha256.h"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.c"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.h"
nm_copy_sd_shared "src/shared/dns-domain.c"
nm_copy_sd_shared "src/shared/dns-domain.h"
nm_copy_sd_shared "src/shared/log-link.h"
nm_copy_sd_shared "src/shared/web-util.c"
nm_copy_sd_shared "src/shared/web-util.h"
nm_copy_sd_stdaux "src/basic/unaligned.h"
2022-07-05 18:23:12 +02:00
Lubomir Rintel
47d14bced8 contrib/rpm: BR pexpect
Unit tests need this to run.

Fixes: 9570224e86 ('tests/client: add a pexpect-based test runner')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1285
2022-07-04 17:35:59 +02:00
Thomas Haller
287a34990a libnm: fix timestamp in LIBNM_CLIENT_DEBUG debug logging
Fixes: 9c01d6ca67 ('libnm: print timestamp in LIBNM_CLIENT_DEBUG debug logging')
2022-07-04 16:57:23 +02:00
Thomas Haller
ea85f6dfa3 libnm: fix "parameters" argument in nm_client_dbus_call() to be optional
It was documented to be an optional parameter. That is also in line
with g_dbus_connection_call(), which is essentially wrapped by nm_client_dbus_call().

Fixes: ce0e898fb4 ('libnm: refactor caching of D-Bus objects in NMClient')
2022-07-04 16:57:22 +02:00
Beniamino Galvani
cadb4fddd2 merge: branch 'leak'
supplicant: fix a memory leak

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1289
2022-07-04 13:14:23 +00:00
Slava Monich
8c5356cec6 supplicant: fix a memory leak
==30980== 8 bytes in 1 blocks are definitely lost in loss record 1,117 of 6,137
==30980==    at 0x4841C38: malloc (vg_replace_malloc.c:309)
==30980==    by 0x4A246C7: g_malloc (gmem.c:106)
==30980==    by 0x4A4A4BB: g_variant_get_strv (gvariant.c:1607)
==30980==    by 0x4A4CA73: g_variant_valist_get_nnp (gvariant.c:4901)
==30980==    by 0x4A4CA73: g_variant_valist_get_leaf (gvariant.c:5058)
==30980==    by 0x4A4CA73: g_variant_valist_get (gvariant.c:5239)
==30980==    by 0x4A4D11D: g_variant_get_va (gvariant.c:5502)
==30980==    by 0x4A4D1BD: g_variant_lookup (gvariant.c:989)
==30980==    by 0xE9389: parse_capabilities (nm-supplicant-interface.c:1241)
==30980==    by 0xEBF99: _properties_changed_main (nm-supplicant-interface.c:1941)
==30980==    by 0xEF549: _properties_changed (nm-supplicant-interface.c:2867)
==30980==    by 0xEF7ED: _get_all_main_cb (nm-supplicant-interface.c:2972)
==30980==    by 0x262057: _nm_dbus_connection_call_default_cb (nm-dbus-aux.c:70)
==30980==    by 0x48DB6A3: g_task_return_now (gtask.c:1215)
==30980==    by 0x48DBF43: g_task_return.part.3 (gtask.c:1285)
==30980==    by 0x4918885: g_dbus_connection_call_done (gdbusconnection.c:5765)
==30980==    by 0x48DB6A3: g_task_return_now (gtask.c:1215)
==30980==    by 0x48DB6D7: complete_in_idle_cb (gtask.c:1229)
==30980==    by 0x4A20981: g_main_dispatch (gmain.c:3325)
==30980==    by 0x4A20981: g_main_context_dispatch (gmain.c:4016)
==30980==    by 0x4A20BEF: g_main_context_iterate.isra.23 (gmain.c:4092)
==30980==    by 0x4A20E33: g_main_loop_run (gmain.c:4290)
==30980==    by 0x2C5C9: main (main.c:509)

Fixes: cd1e0193ab ('supplicant: add BIP interface capability')
2022-07-04 15:39:40 +03:00
Beniamino Galvani
fb4ac007ba wifi: wait supplicant to settle before renewing DHCP after roam
After roaming to a different AP, if we trigger a DHCP renewal while
the supplicant is still reauthenticating the REQUEST will be lost and
the client will fall back to sending a DISCOVER, potentially getting a
different address.

Wait that the supplicant state settles before renewing.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1024
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1263
2022-07-04 13:21:06 +02:00
Yuri Chornoivan
08e90a7a87 po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1288
2022-07-04 11:36:00 +02:00
Thomas Haller
9bfe690ab7 libnm/docs: expand documentation for wireguard.ip4-auto-default-route 2022-06-30 21:30:49 +02:00
Lubomir Rintel
02685e990e release: bump version to 1.39.8 (development) 2022-06-30 16:18:01 +02:00
Thomas Haller
cd63708d17 platform: merge branch 'th/platform-nmp-object-lookup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1281
2022-06-30 14:20:45 +02:00
Thomas Haller
5245fc6c75 platform: rename nmp_lookup_init_object() to nmp_lookup_init_object_by_ifindex()
In the past, nmp_lookup_init_object() could both lookup all object for a
certain ifindex, and lookup all objects of a type. That fallback path
already leads to an assertion failure fora while now, so nobody should
be using this function to lookup all objects of a certain type (for
what, we have nmp_lookup_init_obj_type()).

Now, remove the fallback path, and rename the function to what it really
does.
2022-06-30 14:08:41 +02:00
Thomas Haller
902812ce49 platform: use memset() in _nmp_object_stackinit_from_class()
NMPObject is a union. It's not clear to me that C guarnatees that
designated initializers will meaningfully set all fields to zero. Use
memset() instead.
2022-06-30 14:08:40 +02:00
Lubomir Rintel
af447c493c merge: branch 'lr/client-ask-mode'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1282
2022-06-30 11:15:18 +02:00
Lubomir Rintel
9a70d4e819 tests/client: add interactive add test 2022-06-30 10:20:44 +02:00
Lubomir Rintel
a3f0db06e4 tests/client: do not consult expected result files if no checks require them
Perhaps the test is not using call_nmcli*(), but still wants to use
@nm_test decorator to set up the mock service.
2022-06-30 10:20:44 +02:00
Lubomir Rintel
9570224e86 tests/client: add a pexpect-based test runner
Useful for testing interactive commands against a mock service.
2022-06-30 10:20:44 +02:00
Lubomir Rintel
12fe0ae312 contrib/packages: install pexpect
We'd like to use this for client unit testing.
2022-06-30 10:20:44 +02:00
Thomas Haller
78cd45f1b5 man: extend man NetworkManager-wait-online.service with examples 2022-06-30 10:19:32 +02:00
Thomas Haller
e6a33c04eb all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.

For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:

  # /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
  [connection-90-ipv6-addr-gen-mode-override]
  match-device=type:ethernet
  ipv6.addr-gen-mode=0

"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.

- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
  key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
  default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
  "stable-privacy".
- when some tool creates a profile, they either can explicitly
  set the mode, or they get the default of the underlying mechanisms
  above.

  - nm-initrd-generator explicitly sets "eui64" for profiles it creates.
  - nmcli doesn' explicitly set it, but inherits the default form
    libnm's ip6-config::addr-gen-mode.
  - when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
    it inherits the default from libnm's ip6-config::addr-gen-mode.

Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.

Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.

Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.

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

See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-06-29 07:38:48 +02:00
Thomas Haller
7f766014c5 team: specify cli-type for teamdctl_connect() to select usock/dbus
teamdctl_connect() has a parameter cli_type. If unspecified, the
library will try usock, dbus (if enabled) and zmq (if enabled).

Trying to use the unix socket if we expect to use D-Bus can be bad. For
example, it might cause SELinux denials.

As we anyway require libteam to use D-Bus, if D-Bus is available,
explicitly select the cli type.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1255
2022-06-27 14:04:40 +02:00
Lubomir Rintel
e3c0679859 merge: branch 'lr/gettext-2'
This is essentially work started by Martin Blanchard and improved by
Javier Jardón with some fixups.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094
2022-06-27 13:40:09 +02:00
Lubomir Rintel
28a53403d1 ci: trivial changes to comments
Hopefully for better not worse.
2022-06-27 13:40:09 +02:00
Lubomir Rintel
9fdb6bea44 ci: drop Ubuntu 16.04
It's sad, old and unsupported. Also its gettext is old and smells of
elderberries.
2022-06-27 13:40:09 +02:00
Lubomir Rintel
978d8eb699 po: make dist depend on update-po
This works around a race condition with gettext Makefile.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
2022-06-27 13:40:09 +02:00
Martin Blanchard
19a6affd3a build: stop relying on intltool for i18n
Recent gettext version can extract and merge back strings from and to
various file formats, no need for intltool anymore.

https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/133

https://github.com/NetworkManager/NetworkManager/pull/303
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/96

Clarification about the use of AM_GNU_GETTEXT_REQUIRE_VERSION:

In configure.ac, specify the minimum gettext version we require, rather
than the exact one. This fixes a situation where the autoconf macros
used for gettext will be the latest available on the system (for
example, 0.20); but the copied-in Makefile.in.in will be for the exact
version specified in configure.ac (in this case, 0.19).

In that situation, the gettext build rules will error out at `make` time
with the message:
   *** error: gettext infrastructure mismatch: using a Makefile.in.in
   from gettext version 0.19 but the autoconf macros are from gettext
   version 0.20

Avoid that by specifying a minimum version dependency rather than an
exact one. This should not cause problems as we haven’t committed any
generated or external gettext files into git, so each developer will end
up regenerating the build system for their system’s version of gettext,
as expected.

See the subsection of
https://www.gnu.org/software/gettext/manual/html_node/Version-Control-Issues.html
for more information.

Note that autoreconf currently doesn’t recognise
AM_GNU_GETTEXT_REQUIRE_VERSION, so we must continue also using
AM_GNU_GETTEXT_VERSION. autopoint will ignore the latter if the former
is present. See
https://lists.gnu.org/archive/html/autoconf-patches/2015-10/msg00000.html.

[lkundrak@v3.sk: Fixed the meson build, adjusted autogen.sh:
droped "|| exit 1", dropped call to aclocal,
dropped --copy from gtkdocize.]
2022-06-27 13:40:09 +02:00
Beniamino Galvani
bf9a2babb4 platform: fix routing rule test failure
Since kernel 5.18 there is a stricter validation [1][2] on the tos
field of routing rules, that must not include ECN bits.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f55fbb6afb8d701e3185e31e73f5ea9503a66744
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a410a0cf98854a698a519bfbeb604145da384c0e

Fixes the following failure:

  >>> src/core/platform/tests/test-route-linux
  >>> ...
  # NetworkManager-MESSAGE: <warn>  [1656321515.6604] platform-linux: do-add-rule: failure 22 (Invalid argument - Invalid dsfield (tos): ECN bits must be 0)
  >>> failing... errno=-22, rule=[routing-rule,0x13d6e80,1,+alive,+visible; [6] 0: from all tos 0xff fwmark 0x4/0 suppress_prefixlen -459579276 action-214 protocol 255]
  >>> existing rule: * [routing-rule,0x13d71e0,2,+alive,+visible; [6] 0: from all sport 65534 lookup 10009 suppress_prefixlen 0 none]
  >>> existing rule:   [routing-rule,0x13d7280,2,+alive,+visible; [4] 0: from all fwmark 0/0x9a7e9992 ipproto 255 suppress_prefixlen 0 realms 0x00000008 none protocol 71]
  >>> existing rule:   [routing-rule,0x13d7320,2,+alive,+visible; [6] 598928157: from all suppress_prefixlen 0 none]
  >>> existing rule:   [routing-rule,0x13d73c0,2,+alive,+visible; [4] 0: from 192.192.5.200/8 lookup 254 suppress_prefixlen 0 none protocol 9]
  >>> existing rule:   [routing-rule,0x13d7460,2,+alive,+visible; [4] 0: from all ipproto 3 suppress_prefixlen 0 realms 0xffffffff none protocol 5]
  >>> existing rule:   [routing-rule,0x13d7500,2,+alive,+visible; [4] 0: from all fwmark 0x1/0 lookup 254 suppress_prefixlen 0 action-124 protocol 4]
  >>> existing rule:   [routing-rule,0x13d75a0,2,+alive,+visible; [4] 0: from all suppress_prefixlen 0 action-109]
  0:      from all fwmark 0/0x9a7e9992 ipproto ipproto-255 realms 8 none proto 71
  0:      from 192.192.5.200/8 lookup main suppress_prefixlength 0 none proto ra
  0:      from all ipproto ggp realms 65535/65535 none proto 5
  0:      from all fwmark 0x1/0 lookup main suppress_prefixlength 0 124 proto static
  0:      from all 109
  0:      from all sport 65534 lookup 10009 suppress_prefixlength 0 none
  598928157:      from all none
  Bail out! nm:ERROR:../src/core/platform/tests/test-route.c:1787:test_rule: assertion failed (r == 0): (-22 == 0)

Fixes: 5ae2431b0f ('platform/tests: add tests for handling policy routing rules')
2022-06-27 13:31:08 +02:00
Beniamino Galvani
c47edbb199 merge: branch 'bg/route-attrs'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1274
2022-06-27 11:39:22 +02:00
Beniamino Galvani
90e7afc2cd libnm,core: add support for {rto_min,quickack,advmss} route attributes 2022-06-27 11:38:43 +02:00