Commit graph

31107 commits

Author SHA1 Message Date
Yuri Chornoivan 4f7164f435
po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1412
2022-10-05 09:24:41 +02:00
Thomas Haller ddcf379c1a
systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1411
2022-10-05 09:21:28 +02:00
Thomas Haller 46b36083ce
systemd: drop invalid "user-util.h" compat header
We included the original "user-util.h" header. There must
be no compat header.
2022-10-04 16:10:14 +02:00
Thomas Haller a3460730f2
systemd: update code from upstream (2022-10-04)
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=f77c0840d505825f14ff30921752cb26778bf53e

(
  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-lease-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/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-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-10-04 13:25:31 +02:00
Thomas Haller 6ef929d19f
bond: merge branch 'th/mlag-bonding-slb'
https://bugzilla.redhat.com/show_bug.cgi?id=2128216

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1385
2022-10-04 12:37:42 +02:00
Thomas Haller 22f670687a
libnm,core: support "bond.balance-slb" option 2022-10-04 12:37:41 +02:00
Thomas Haller 5450be31d9
core: add NMBondManager to handle NTF rules for balance-slb (MLAG) 2022-10-04 12:37:41 +02:00
Thomas Haller e9268e3924
firewall: add mlag firewall utils for multi chassis link aggregation (MLAG) for bonding-slb
Add a way to configure MLAG NFT rules for SLB bonding.

OVS supports "bonding-slb" (source load balancing, [1]). This is
basically setting "mode=balance-xor" and "xmit_hash_policy=vlan+srcmac",
which requires no special switch configuration (like LACP). For that to
work, we need to filter out packets that the switch sends back on the
other port, for which we configure some NFT rules.

The rules are taken from mlag.sh at [2] or [3].

See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1724795

[1] https://docs.openvswitch.org/en/latest/topics/bonding/#slb-bondin
[2] https://gitlab.com/egarver/virtual-networking
[3] https://gitlab.com/jtoppins_redhat/bond-slb-nft
2022-10-04 12:37:41 +02:00
Beniamino Galvani 718392ef5f nmcli: merge branch 'bg/nmcli-dev-connect-error'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1409
2022-10-04 10:07:33 +02:00
Beniamino Galvani 1a77108dcb nmcli: don't show state-reason for "nmcli device connect" errors
It's confusing to show a state-reason number different from nmcli
return values.
2022-10-04 10:06:54 +02:00
Beniamino Galvani 5cf9395b94 nmcli: fix return code on "nmcli device connect" error
Before:
  $ nmcli device connect veth0; echo $?
  Error: Connection activation failed: (5) IP configuration could not be reserved (no available address, timeout, etc.).
  0

After
  $ nmcli device connect veth0; echo $?
  Error: Connection activation failed: (5) IP configuration could not be reserved (no available address, timeout, etc.).
  4

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/902
2022-10-04 10:06:54 +02:00
Thomas Haller 88f5e7518a
doc: fix bind-activation description for AddAndActivateConnection2 D-Bus API
Fixes: eb883e34a5 ('core: Add option to AddAndActivateConnection2 to bind the lifetime')
2022-10-03 20:30:20 +02:00
Thomas Haller 2ecfec708f
all: merge branch 'th/uuid-generate-from-strings'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1403
2022-10-03 18:03:20 +02:00
Thomas Haller e9a33bbbf8
all: drop nm_uuid_generate_from_strings_v3()
For new uses of nm_uuid_generate_from_strings() we should generate version5
UUIDs and we should use unique namespace UUID arguments.

The namespace UUID was so far replaced by always passing a special prefix
as first string. It seems nicer to use a namespace instead.

Version3 UUIDs should not be used for new applications.

Hence, nm_uuid_generate_from_strings_v3() is no longer a desirable way to
generate UUIDs, so drop the wrapper.
2022-10-03 17:57:53 +02:00
Thomas Haller 7e33ef916a
libnm-core/tests: drop duplicate tests _check_uuid_v3() (2)
The previous commits show that the behavior is the same.
We can not drop these checks.
2022-10-03 17:57:51 +02:00
Thomas Haller d527181e1f
libnm-core/tests: drop duplicate tests _check_uuid_v3()
As the unit test shows, the behavior is the same.
2022-10-03 17:57:49 +02:00
Thomas Haller 871c82fd5f
glib-aux: implement nm_uuid_generate_from_strings_legacy() in terms of nm_uuid_generate_from_strings()
As the unit tests show, the behavior is the same.
2022-10-03 17:57:48 +02:00
Thomas Haller f849426b84
glib-aux: avoid leaking secrets in memory during nm_uuid_generate_from_strings_strv()
Some snake oil, but this is a low level function and we don't know
whether the caller doesn't try to hash secret information. Just clear
the buffer after use.
2022-10-03 17:57:46 +02:00
Thomas Haller 168bc7f120
glib: add nm_uuid_generate_from_strings() helper
nm_uuid_generate_from_strings() accepts a uuid_type and type_arg
parameter, so that we can use it to generate version 5 UUIDs.

This is a more flexible variant of nm_uuid_generate_from_strings_v3(),
which will be used to replace it. With the right parameters, the new
function behaves the same as nm_uuid_generate_from_strings_v3().
2022-10-03 17:57:45 +02:00
Thomas Haller a33459ed2f
libnm/tests: drop redundant argument in test code 2022-10-03 17:57:44 +02:00
Thomas Haller 2fcea1cf05
glib-aux: rename nm_uuid_generate_from_strings() to nm_uuid_generate_from_strings_v3()
nm_uuid_generate_from_strings() uses variant3 UUIDs based on MD5.
We shouldn't use that in the future.

We will add a replacement, so rename this function so that the "good"
name is free again. Of course, code that uses this function currently
relies on that the behavior doesn't change. We cannot just drop it
entirely, but will replace it by something that gives the same result.

Rename.
2022-10-03 17:57:43 +02:00
Thomas Haller ee32de41cf
glib-aux: add code comment to NM_UUID_INIT()
`NM_UUID_INIT(00, 09, 01, ...)` would look as if the values are
octal numbers. That is not the case. The macro mangles them,
so that the look like the UUID in string form "000901...".

This is a bit odd. Maybe more confusing than helpful. Or maybe helpful?
2022-10-03 17:57:43 +02:00
Thomas Haller e7582e7dd3
libnm: merge branch 'th/libnm-connection-get-private'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1400
2022-10-03 17:56:40 +02:00
Thomas Haller d75bfd3a3d
libnm: move optimized NM_IS_{SIMPLE,}CONNECTION() to internal header
We already redefine those checks to optimize for NMSimpleConnection.
Which, in particular when libnm-core is used by the daemon, is the only
implementation of the NMConnection interface.

Move those to the private header file. No need to keep it private to
"nm-connection.c".
2022-10-03 17:54:57 +02:00
Thomas Haller 28cb407056
libnm: rework lookup of private data for NMConnection of NMSimpleConnection
NMConnection is an interface, and as such has no data itself.

In practice, there are only two implementations of this interface,
NMSimpleConnection and NMRemoteConnection. The latter only exists
in libnm, not the daemon.

Thus, lookup of the private data is already optimized for
NMSimpleConnection instances via _nm_simple_connection_private_offset.

Use the same mechanism also for NMSimpleConnection itself.
2022-10-03 17:54:56 +02:00
Thomas Haller 5713a533f5
build: merge branch 'th/build-gettext-update-po'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1405
2022-10-03 17:52:19 +02:00
Thomas Haller 7ee0da3eaf
build: don't "update-po" during make dist
Instead, hack gettext's Makefile.

gettext has an issue with parallel make. See [1] and [2].
Reproduce with:

  git reset --hard &&
    git clean -fdx &&
    NOCONFIGURE=yes ./autogen.sh &&
    ./configure --enable-gtk-doc --enable-introspection &&
    make -j distcheck V=1

We worked around this by setting "DIST_DEPENDS_ON_UPDATE_PO = yes",
however that (obviously) results in regenerating source files during
dist. "Source files" in the sense that the po files are commited to git
and get distributed in the release. Doing this is very ugly.

In particular it's ugly, because `make -C po update-po` is not reproducible
and the output depends on the current time (*had one job*).
Otherwise, we could just regenerate the files before doing a release.

This means, running "release.sh" script ends up with a dirty tree
afterwards. Also, the distributed po files are not the ones from the source
tree when we did the release. Also, since "release.sh rc1" does two distributions
(once for the rc1 and once for the next devel snapshot), the commit for the
second distribution will have a large diff for the po files.

This reverts commit 978d8eb699 ('po: make dist depend on update-po')
and hacks around the problem.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1094#note_1435313
[2] https://lists.gnu.org/archive/html/bug-gettext/2022-06/msg00022.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1405
2022-10-03 17:50:09 +02:00
Thomas Haller 991481a568
gitlab: fail if "run-test.sh" with dirty working tree 2022-10-03 17:50:03 +02:00
Thomas Haller 6cbad14721
contrib: discourage g_type_class_add_private() via "checkpatch.pl"
Our GObject structs should be internal API. In which case, we should
embed the private data in the struct themselves (`_priv`) and use the
_NM_GET_PRIVATE() macro. The advantage is better debugability because
following G_TYPE_INSTANCE_GET_PRIVATE() in the debugger is very
cumbersome. Another (less relevant) advantage is better performance.

Thus, warn about uses of g_type_class_add_private() and
G_TYPE_INSTANCE_GET_PRIVATE().

Note that if the struct and is in a header file (which is usually only
necessary when subclassing the type), then the private data should be
an opaque pointer `_priv` instead, and we should use the _NM_GET_PRIVATE_PTR()
macro. In that case, the use of g_type_class_add_private() and
G_TYPE_INSTANCE_GET_PRIVATE() is correct and the warning is false. But
this is only a warning, for the unusual case where we have deep object
hierarchies.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1396
2022-10-03 17:23:29 +02:00
Marc Muehlfeld 531cc96737 man/NetworkManager-wait-online.service: clean up
I rewrote the man page to make it clearer and easier to understand.
Additionally, I fixed some typos and grammar issues.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1390
2022-10-03 16:28:44 +02:00
Thomas Haller 7adde3f2fc
nmcli: don't print warning in nmcli connection import about duplicate parameters
It seems uncommon that a command line tool warns about duplicate
paramters. Usually, the latter just overwrites the former. That is also
useful so that you can have for example an alias that sets a default
type

  nmcli_import="nmcli connection import type keyfile"

but still call it like

  nmcli_import file $FILE type openvpn

This is a change in behavior. Not only stop we printing a warning, we
will now prefer the latter argument. Previously, the first was honored.
This change in behavior is a problem, but such uses were warned against
in the past, and hopefully nobody did this or relied on this.
2022-10-03 13:59:12 +02:00
Beniamino Galvani 394501e65a po: add missing files to POTFILES.in
Fixes: 9b396f7cc8 ('nmtui: add MACsec support')
Fixes: 7b067be580 ('nmtui: introduce Nmt8021xFields')
2022-10-03 09:44:20 +02:00
Thomas Haller c5beec90a8
core: merge branch 'th/mlag-bonding-slb' (part 2)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1385
2022-09-29 14:43:36 +02:00
Thomas Haller e796a67d6c
firewall: introduce helper function for add/flush/delete nft table command 2022-09-29 14:41:59 +02:00
Thomas Haller 02feefb1df
firewall: fail from nm_firewall_nft_call() on non-zero exit code 2022-09-29 14:41:59 +02:00
Thomas Haller 607a9544cb
device: allow resetting the devip state via nm_device_devip_set_state()
There is no reason to disallow resetting the state.
2022-09-29 14:41:58 +02:00
Thomas Haller a5f125f8cb
glib-aux: add NM_UTILS_ERROR_COMMAND_FAILED error code 2022-09-29 14:41:58 +02:00
Thomas Haller 95e6ebec66
glib-aux: add nm_utils_get_process_exit_status_desc_buf() helper 2022-09-29 14:41:58 +02:00
Thomas Haller cd2f8945c9
device: merge branch 'th/mlag-bonding-slb' (part 1)
Small spin-off from merge request with minor cleanups.
Merge early.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1385
2022-09-29 14:40:24 +02:00
Thomas Haller 45eab7b2d8
core: obfuscate pointer value in logging in "nm-active-connection.c" 2022-09-29 14:40:12 +02:00
Thomas Haller 0d764715dd
device: downgrade warning level for logging in nm_device_queue_state()
This is something that does happen.

Is that a bug? If so, this should not be a warning message but an
assertion failure. If it's not a bug, then this does not warrant warning
level, because the user wouldn't know what to do about this and it's
something that occasionally happens.

Granted, the state handling in NMDevice is complex, that it's unclear
whether this indicates a problem or not. In any case, having a warning
does only confuse the user.
2022-09-29 14:40:11 +02:00
Thomas Haller cf942832c3
device: simplify resource management in nm_device_master_release_slave() 2022-09-29 14:40:11 +02:00
Fernando Fernandez Mancera 07e0ab48d1 veth: drop iface peer check during create_and_realize()
When fetching the parent device, if the system is slow, NetworkManager
can hit a race condition where the property is still NULL. In that case,
NetworkManager should create the veth link.

Checking that the peer device exists, it is type NM_DEVICE_TYPE_VETH and
it have a parent device is enough to know that we can skip the link
creation.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1399

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

Fixes: 4655b7c308 ('veth: fix veth activation on booting')
2022-09-29 10:29:28 +02:00
Thomas Haller 520411623d
glib-aux: fix nm_str_buf_finalize() for cloning buffer
NMStrBuf can also contains NUL characters. We thus cannot use g_strndup(),
which uses strncpy() and truncates at the first NUL.

Fixes: 13d25f9d0b ('glib-aux: add support for starting with stack-allocated buffer in NMStrBuf')
2022-09-29 08:21:00 +02:00
Thomas Haller 786bb9d048
NEWS: update 2022-09-28 21:37:00 +02:00
Thomas Haller a80bb943b1
contrib: add entries to bash_history for nm-in-container.sh script 2022-09-28 18:35:48 +02:00
Thomas Haller 1fa9db0705
contrib: add entries to bash_history for nm-in-container.sh script 2022-09-28 17:51:15 +02:00
Thomas Haller af85961ea1
all: merge branch 'th/array-find-bsearch'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1397
2022-09-28 13:32:02 +02:00
Thomas Haller efcc030752
std-aux/trivial: fix typo in code comment 2022-09-28 13:30:45 +02:00
Thomas Haller f786b05479
glib-aux: swap arguments for nm_array_find_bsearch()
Have "len" before "elem_size". That is consistent with g_qsort_with_data()
and bsearch(), and is also what I would expect.

Note that the previous commit just renamed the function. If a user
of the new, changed API gets backported to an older branch, we will
get a compilation error and note that the arguments need to be adjusted.
2022-09-28 13:30:44 +02:00