Commit Graph

33346 Commits

Author SHA1 Message Date
Jan Vaclav
fa747f6478 gitlab-ci: ignore autotools deprecation
We still need the tests to run on autotools builds too, so we must pass the argument.

(cherry picked from commit 5f72b251b1)
2024-05-09 12:00:47 +02:00
Jan Vaclav
17ec5da34a contrib/fedora: update scripts to expect autotools deprecation
(cherry picked from commit 7b4acf938c)
2024-05-09 12:00:14 +02:00
Jan Vaclav
c3a050bad1 build: break autotools configuration to warn about deprecation
We are planning on completely dropping Autotools in the future.
This breaks the build process with an argument to ignore the deprecation,
so that anyone building NM is warned of this change.

(cherry picked from commit d115dcec50)
2024-05-09 12:00:04 +02:00
Jan Vaclav
edb6fa1dd7 merge: branch 'jv/break-autotools'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1931
2024-05-09 09:34:37 +00:00
Jan Vaclav
5f72b251b1 gitlab-ci: ignore autotools deprecation
We still need the tests to run on autotools builds too, so we must pass the argument.
2024-05-06 17:22:20 +02:00
Jan Vaclav
7b4acf938c contrib/fedora: update scripts to expect autotools deprecation 2024-05-06 16:39:08 +02:00
Jan Vaclav
d115dcec50 build: break autotools configuration to warn about deprecation
We are planning on completely dropping Autotools in the future.
This breaks the build process with an argument to ignore the deprecation,
so that anyone building NM is warned of this change.
2024-05-06 15:25:50 +02:00
Íñigo Huguet
3eb24b43ad merge: branch 'ih/ci-clean-images'
CI: periodically clean image's registry

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1924
2024-05-06 09:03:27 +00:00
Íñigo Huguet
7a48290dca ci: disable the "triage issues" job
This job was supposed to run periodically. However, it stopped working
when a "workflow" section was added to .gitlab-ci.yml because it
prevented pipelines of the type "scheduled" to be created.
7fa72645e5 ('gitlab-ci: make detached MR pipeline for external contributor's pipelines to run')

Now, if it's run, it fails with error:
multi_xml requires Ruby version >= 3.1.4. The current ruby version is 2.7.8.225.

Let's disable the job until we fix it and we decide what triage we want
to do. When we do it, we will need to adapt the jobs to be run with the
right periodicity, maybe using custom pipeline variables.
2024-05-06 09:02:36 +00:00
Íñigo Huguet
69efb4660c CI: periodically clean image's registry
This will force to regenerate the various images of the distributions
that we want to test so we get an updated snapshot on them. Otherwise we
might be testing a months old version of them.

A bug in ci-fairy was making the deletion of the images to partially
fail. It is fixed in the latest version of ci-fairy, so we need to
update the value of templates_sha to pick it.

The task will run only on pipelines of type "scheduled". Then we can
create a weekly scheduled pipeline in Gitlab.
2024-05-06 09:02:36 +00:00
Jan Vaclav
5fae0403b8 contrib/rpm: use meson by default for builds on RHEL10
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on RHEL 10.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1929
2024-05-06 08:13:44 +00:00
Fernando Fernandez Mancera
d8c4e70533 release: bump version to 1.49.0 (development) 2024-05-03 18:12:46 +02:00
Fernando Fernandez Mancera
8be0ba422d release: bump version to 1.47.90 (1.48-rc1) 2024-05-03 18:07:22 +02:00
Fernando Fernandez Mancera
e1a0323fdd release.sh: adjust build path to meson-dist 2024-05-03 18:05:54 +02:00
Beniamino Galvani
a0f798342a merge: branch 'bg/rollback-in-memory'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1920
2024-05-03 09:41:24 +02:00
Beniamino Galvani
c979bfeb8b checkpoint: preserve in-memory state of connections
If a connection is in-memory (i.e. has flag "unsaved"), after a
checkpoint and rollback it can be wrongly persisted to disk:

 - if the connection was modified and written to disk after the
   rollback, during the rollback we update it again with persist mode
   "keep", which keeps it on disk;

 - if the connection was deleted after the rollback, during the
   rollback we add it again with persist mode "to-disk".

Instead, remember whether the connection had the "unsaved" flag set
and try to restore the previous state.

However, this is not straightforward as there are 4 different possible
states for the settings connection: persistent; in-memory only;
in-memory shadowing a persistent file; in-memory shadowing a detached
persistent file (i.e. the deletion of the connection doesn't delete
the persistent file). Handle all those cases.

Fixes: 3e09aed2a0 ('checkpoint: add create, rollback and destroy D-Bus API')
2024-05-02 16:49:23 +02:00
Beniamino Galvani
a48b7fe7b9 settings: add nm_settings_connection_persist_mode_to_string() 2024-05-02 16:49:16 +02:00
Íñigo Huguet
064f20aa62 merge: branch 'ih/rt6_replace_resync'
platform: avoid routes resync for routes that we don't track

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1930
2024-05-02 10:50:07 +00:00
Íñigo Huguet
4d426f581d platform: avoid routes resync for routes that we don't track
When we recibe a Netlink message with a "route change" event, normally
we just ignore it if it's a route that we don't track (i.e. because of
the route protocol).

However, it's not that easy if it has the NLM_F_REPLACE flag because
that means that it might be replacing another route. If the kernel has
similar routes which are candidates for the replacement, it's hard for
NM to guess which one of those is being replaced (as the kernel doesn't
have a "route ID" or similar field to indicate it). Moreover, the kernel
might choose to replace a route that we don't have on cache, so we know
nothing about it.

It is important to note that we cannot just discard Netlink messages of
routes that we don't track if they has the NLM_F_REPLACE. For example,
if we are tracking a route with proto=static, we might receive a replace
message, changing that route to proto=other_proto_that_we_dont_track. We
need to process that message and remove the route from our cache.

As NM doesn't know what route is being replaced, trying to guess will
lead to errors that will leave the cache in an inconsistent state.
Because of that, it just do a cache resync for the routes.

For IPv4 there was an optimization to this: if we don't have in the
cache any route candidate for the replacement there are only 2 possible
options: either add the new route to the cache or discard it if we are
not interested on it. We don't need a resync for that.

This commit is extending that optimization to IPv6 routes. There is no
reason why it shouldn't work in the same way than with IPv4. This
optimization will only work well as long as we find potential candidate
routes in the same way than the kernel (comparing the same fields). NM
calls to this "comparing by WEAK_ID". But this can also happen with IPv4
routes.

It is worth it to enable this optimization because there are routing
daemons using custom routing protocols that makes tens or hundreds of
updates per second. If they use NLM_F_REPLACE, this caused NM to do a
resync hundreds of times per second leading to a 100% CPU usage:
https://issues.redhat.com/browse/RHEL-26195

An additional but smaller optimization is done in this commit: if we
receive a route message for routes that we don't track AND doesn't have
the NLM_F_REPLACE flag, we can ignore the entire message, thus avoiding
the memory allocation of the nmp_object. That nmp_object was going to be
ignored later, anyway, so better to avoid these allocations that, with
the routing daemon of the above's example, can happen hundreds of times
per second.

With this changes, the CPU usage doing `ip route replace` 300 times/s
drops from 100% to 1%. Doing `ip route replace` as fast as possible,
without any rate limitting, still keeps NM with a 3% CPU usage in the
system that I have used to test.
2024-04-30 13:13:46 +02:00
Jan Vaclav
32063f01b3 CONTRIBUTING: remove autotools instructions, add more information about meson
This commit updates the CONTRIBUTING.md file to remove information
about Autotools and add some additional tips for using meson.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1927
2024-04-29 08:50:13 +00:00
Íñigo Huguet
7faa351e4d merge: branch 'ih/802-1x_cert_doc'
doc: remove explanations about certificate schemes from nmcli

Closes #1479

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1926
2024-04-26 07:30:22 +00:00
Íñigo Huguet
0906bd6e8b doc: remove explanations about certificate schemes from nmcli
The D-Bus and C APIs admit setting the 802.1X certificates as blobs, as
the documentation of the properties explains.  However, this is not
possible from nmcli, where only path to the certificates' files is possible.

This difference in nmcli was explained in the description message that
is shown in nmcli's editor, but this is a documentation that most users
won't ever see, and still the main documentation in nm-settings-nmcli is
missleading.

Add a nmcli specific documentation for the relevant properties and
remove the nmcli's editor descriptions as they are no longer needed.
2024-04-26 07:30:04 +00:00
Jan Vaclav
069d854f8c merge: branch 'jv/meson-build-default'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1912
2024-04-24 15:12:44 +02:00
Beniamino Galvani
29eab139bf merge: branch 'bg/rpm-rhel-features'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1921
2024-04-24 09:53:28 +02:00
Beniamino Galvani
e79e1d637e rpm: disable ifcfg-rh in future versions of RHEL 2024-04-24 09:52:55 +02:00
Beniamino Galvani
bc73478a49 rpm: disable team support in future versions of RHEL 2024-04-24 09:52:55 +02:00
Beniamino Galvani
37d23888cb merge: branch 'main'
update DocBook DTD version to latest stable 4.5

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1900
2024-04-22 12:06:54 +00:00
Tomasz Kłoczko
20677c175d update DocBook DTD version to latest stable 4.5
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
2024-04-22 12:06:16 +00:00
Fernando Fernandez Mancera
5e043966a1 merge: branch 'ff/sync_systemd'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1923
2024-04-22 11:00:28 +02:00
Fernando Fernandez Mancera
e59dce9488 merge: branch 'systemd' into ff/sync_systemd 2024-04-19 18:16:22 +02:00
Fernando Fernandez Mancera
cd87004dfb systemd: update code from upstream (2024-04-19)
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=fa6ea8095855696cf14cb65214020cdcdee79d6b

(
  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-fundamental.h \
                :/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/dhcp-duid-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-client-internal.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/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-duid.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/sd-device/device-internal.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.h"
nm_copy_sd_core "src/libsystemd/sd-device/sd-device.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-device.h"
nm_copy_sd_core "src/systemd/sd-dhcp-duid.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-dhcp6-protocol.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-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/arphrd-util.h"
nm_copy_sd_shared "src/basic/btrfs.c"
nm_copy_sd_shared "src/basic/btrfs.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/chase.h"
nm_copy_sd_shared "src/basic/constants.h"
nm_copy_sd_shared "src/basic/devnum-util.c"
nm_copy_sd_shared "src/basic/devnum-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/iovec-util.h"
nm_copy_sd_shared "src/basic/label.c"
nm_copy_sd_shared "src/basic/label.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/lock-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_threads.h"
nm_copy_sd_shared "src/basic/missing_type.h"
nm_copy_sd_shared "src/basic/namespace-util.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/origin-id.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/pidref.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/fundamental/logarithm.h"
nm_copy_sd_shared "src/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/memory-util-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"
nm_copy_sd_stdaux "src/fundamental/unaligned-fundamental.h"
2024-04-19 17:39:23 +02:00
Beniamino Galvani
0a3917e6a1 merge: branch 'wwan-ipv6-dhcp-fix'
wwan: Perform SLAAC and DNS assignment when IPv6 is set to auto method, even without address from the bearer

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1440
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1918
2024-04-19 07:42:57 +00:00
Pavel Valach
498142d942 wwan: perform SLAAC and DNS assignment when IPv6 is on auto method
This allows SLAAC for IPv6 to be performed, even when no IPv6
address was passed by the bearer. The link-local address will be
assigned, because of do_auto = TRUE.

The commit also allows the DNS assignment to be made statically when
no IPv6 address has been statically assigned yet. This is to be able
to receive IPv6 DNS servers via signalling, where host SLAAC still
needs to be performed for some modems (e.g. some huawei modems).

This also changes the logging so that SLAAC usage is logged
on a separate line.
2024-04-19 07:35:38 +00:00
Pavel Valach
495a64cc3c wwan: use separate gateway variables for IPv6 in stage3_ip_config_start
Even if this is not strictly necessary, it is more in line with
what is done for IPv4 and it prevents the accidental mixup
of address_string values.
2024-04-19 07:35:38 +00:00
Íñigo Huguet
92e19b01ac release: bump version to 1.47.5 (development) 2024-04-19 08:19:10 +02:00
Jan Vaclav
38c799d883 contrib/rpm: use meson by default for builds on rawhide
As part of our plan to deprecate autotools, we will now be using meson
by default to build NM releases on Rawhide.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1905
2024-04-18 13:31:50 +00:00
Íñigo Huguet
cb9a3bdf0c merge: branch 'ih/deprec_comment'
man: fix missing deprecation message

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1922
2024-04-18 13:31:00 +00:00
Íñigo Huguet
7427e9d320 man: fix missing deprecation message
In the gtkdoc comments, the text below tags like `Since: 1.2` is
discarded. In the property `autoconnect-slaves` a line indicating its
deprecation was below one of these tags. As a result, it was missing in
the man page. Fix it.

Fixes: 194455660d ('connection: deprecate NMSettingConnection autoconnect-slaves property')
2024-04-18 13:30:31 +00:00
Jan Vaclav
886146b5b1 platform/netlink: use nm_random_get_bytes() for initial seq value
Coverity warns when a time_t is cast to 32-bits -- however, we do not
need to use the time here at all, since it is only used as an initializing value
that is not expected to be a timestamp, and we can use random bytes instead.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1904
2024-04-17 08:30:46 +00:00
Jan Vaclav
e42ef92bfa meson: add runtime_dir option
Adds a runtime_dir option to the meson options, which allows the user to
specify the run directory when building. This commit also changes it so
that `/run` is set as the default run directory if building with /usr prefix.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1919
2024-04-15 15:03:35 +02:00
Íñigo Huguet
94756668f9 merge: branch 'ih/ci-distros'
ci: update distributions that we test in the CI

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1913
2024-04-08 06:37:10 +00:00
Íñigo Huguet
56179465df Updated code format
The CI will use Fedora 40 for code formatting check. Update the code
formatting so it passes.
2024-04-08 06:35:20 +00:00
Íñigo Huguet
ff101ada3a ci: update distributions that we test in the CI
We had an agreement on what distributions should we test and when. We'll
test in Tier 2 those distros that can potentially use the current
version of NM and in Tier 3 those distros that are still maintained (not
EOL'd).

So, Tier 2 is to catch errors that might be severe because might be
blocking for the distributions planning to use the current NM version,
they must be fixed ASAP, before doing the release if possible. These
"distribution versions" will be different for main branch than for
stable branches:
 - Debian 12 uses NM-1.42, so Debian 12 should be Tier 2 in the branch
   nm-1-42.
 - However, Debian 12 will never use newer stable versions, so it should
   be Tier 3 in main branch.

We want to run the Tier 3 tests even if those distros won't use newer
vesions of NM because they are useful to test NM compilation with older
compilers and tools. Fixing failures here might not be considered
urgent, though.

To save resources from Freedesktop we'll run Tier 1 on every MR and
Tiers 2 and 3 before doing a release, or on demand if we need.
2024-04-08 06:35:20 +00:00
Fernando Fernandez Mancera
0bb37455c3 merge: branch 'bg/fix-compilation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1911
2024-04-05 13:27:57 +02:00
Beniamino Galvani
9ff7ff28fc dcb: fix test compilation
GCC 14 with LTO generates the following warning:

  src/core/tests/test-dcb.c: In function 'test_dcb_cleanup':
  src/core/tests/test-dcb.c:283:5: error: array subscript _3 is outside array bounds of 'const char *[0:]' [-Werror=array-bounds=]
    283 |     g_assert_cmpstr(expected.cmds[expected.num], ==, NULL);
        |     ^
  src/core/tests/test-dcb.c:14:17: note: while referencing 'cmds'
     14 |     const char *cmds[];
        |                 ^
  src/core/tests/test-dcb.c:261:24: note: defined here 'expected'
    261 |     static DcbExpected expected = {
        |                        ^

Define the commands as a fixed array instead of flexible array member.
2024-04-05 11:40:45 +02:00
Beniamino Galvani
d369f55192 libnm-core: avoid compiler warnings in team settings
GCC 14 with LTO complains with:

  In function 'nm_team_link_watcher_new_ethtool',
      inlined from 'nm_team_link_watcher_new_ethtool' at src/libnm-core-impl/nm-setting-team.c:106:1:
  src/libnm-core-impl/nm-setting-team.c:130:33: error: array subscript 'struct NMTeamLinkWatcher[0]' is partly outside array bounds of 'unsigned char[16]' [-Werror=array-bounds=]
    130 |     watcher->ref_count          = 1;
        |                                 ^
  src/libnm-core-impl/nm-setting-team.c:128:15: note: object of size 16 allocated by 'g_malloc'
    128 |     watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool));
        |               ^

even if the warning is disabled via pragma directives in that
code. This looks like the following GCC bug:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922

saying

  We do not track warning options (and thus optimize pragmas /
  attributes) across LTO because they are not saved in the function
  specific optimization flag section.

We use a (NMTeamLinkWatcher *) to point to a memory area that is
shorter than the struct, because depending on the watcher type we need
to store different parameters; in this way we can save few bytes of
memory for some watcher types. However, this often breaks when
upgrading the compiler; instead just allocate the full struct.
2024-04-05 11:40:45 +02:00
Beniamino Galvani
fcea2f174e libnm-glib-aux: fix comments about UUID generation
Whether the length is supplied explicitly or implicitly (via -1), the
result is the same. Update the comment.
2024-04-05 11:40:44 +02:00
Beniamino Galvani
2386c0f52d libnm-glib-aux: fix "maybe-uninitialized" error when generating UUID
GCC 14 complans with:

  src/libnm-glib-aux/nm-uuid.c: In function 'nm_uuid_generate_from_strings_strv':
  src/libnm-glib-aux/nm-uuid.c:492:12: error: '_1' may be used uninitialized [-Werror=maybe-uninitialized]
    492 |     return nm_uuid_generate_from_string_str(s, slen, uuid_type, type_args);
        |            ^
  src/libnm-glib-aux/nm-uuid.c:392:1: note: by argument 1 of type 'const char *' to 'nm_uuid_generate_from_string_str' declared here
    392 | nm_uuid_generate_from_string_str(const char   *s,
        | ^

"-Wmaybe-uninitialized" diagnoses passing pointers or references to
uninitialized memory to functions taking const-qualified arguments.

In this case, nm_uuid_generate_from_string_str()'s first argument is a
"const char *" and so the compiler expects that the string is always
initialized. However, it is not initialized when len is zero.

A non-null zero-length array can be specified in two ways: by setting
len to zero, or by setting len to -1 and having NULL as first
element. Handle both cases in the same way.
2024-04-05 11:40:44 +02:00
Beniamino Galvani
c0705faaf2 Revert "fix gcc warnings"
The patch doesn't fix compilation.

This reverts commit 98cabe557f.
2024-04-05 11:40:44 +02:00
Fernando Fernandez Mancera
628371423b release: bump version to 1.47.4 (development) 2024-04-05 10:21:39 +02:00