Commit graph

30873 commits

Author SHA1 Message Date
Thomas Haller
b46d0dcb6f
libnm: undeprecate nm_remote_connection_get_secrets()
Various synchronous methods (D-Bus calls) in libnm's NMClient API were
deprecated. The problem is that NMClient contains a cache of D-Bus
objects, and it gets updated by asynchronous events (D-Bus signals).
Those events get only processed when iterating the GMainContext, but
they are ordered.

When we perform a pseudo blocking D-Bus call with
g_dbus_connection_call_sync(), then GDBus creates a temporary
GMainContext, sends the request and iterates the internal context
blocking for the response. That is, this reply is not synchrounized with
the events that update the NMClient cache.

That is a problem for methods like nm_remote_connection_delete(),
because you call blocking delete, but afterwards the object is still in
the NMClient cache. That's why most blocking methods are deprecated.

While such blocking calls are therefore problematic, they can still be
very convenient to call from a simple script, a test tool or the python
REPL. See "examples/python/gi/nm-wg-set" which calls
nm_remote_connection_get_secrets(), and it would be (unnecessarily)
cumbersome to do the correct thing or using async API.

In particular, nm_remote_connection_get_secrets() doesn't retrieve an object
that is in the NMClient cache in the first place. Sure, the result is
out of order with the cache, but it's not obviously related and in most
cases it wouldn't matter to the user. So undeprecate this function again.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1345
2022-08-25 15:27:35 +02:00
Lubomir Rintel
b58fc7088b tui/wifi: remove WEP options
WEP has been deprecated and is disabled in some distros (RHEL 9) and
wpa_supplicant upstream. Let's remove the option of using it, but also
keep a chicken bit in form of an environment variable for now.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1340
2022-08-25 14:50:02 +02:00
Lubomir Rintel
350dc1a61b newt-form: remove escape-exits property
As far as I can tell, all forms we have should be dismissable with the
Escape key. We omitted settings "escape-exits" property by accident
before. Let's just remove it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1339
2022-08-25 14:12:07 +02:00
Lubomir Rintel
032683a824 tui: allow exiting add/edit connection dialog with ESC key
No reason this wouldn't be allowed.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1339
2022-08-25 14:11:53 +02:00
Thomas Haller
d3a604bbd7
wifi/iwd: merge branch 'balrog-kun/NetworkManager:iwd-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1338
2022-08-24 20:46:36 +02:00
Andrew Zaborowski
e3eac09082
iwd: nm_iwd_manager_get() once and save value
Call nm_iwd_manager_get once on NMDeviceIwd creation and save in
priv->manager to avoid using t very often now that we have 5 new call
sites.  The reasoning is explained in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1338#note_1519684
2022-08-24 20:44:46 +02:00
Andrew Zaborowski
824f2f26db
iwd: Work around timing when new 802.1x connection activated
Try work around the issue documented by Emil Velikov in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1264

When we mirror an 802.1x connection to an IWD config file and there's an
AP in range with matching SSID, that connection should become available
for activation.  In IWD terms when an 802.1x network becomes a Known
Network, it can be connected to using the .Connect D-Bus method.

However there's a delay between writing the IWD config file and receiving
the InterfaceAdded event for the Known Network so we don't immediately
find out that the network can now be used.  If an NM client creates a
new connection for an 802.1x AP and tries to activate it quickly enough,
NMDeviceIWD will not allow it to because it won't know the network is
known yet.  To work around this, we save the SSIDs of 802.1x connections
we recently mirrored to IWD config files, for an arbitrary 2 seconds
period, and we treat them as Known Networks in that period since in
theory activations should succeed.

The alternative proposed in the !1264 is to drop NMDeviceIWD checks that
there's a Known Network for the 802.1x connection being activated since
IWD will eventually perform the same checks and IWD is the ultimate
authority on whether the profile is IWD-connectable.
2022-08-24 20:44:46 +02:00
Andrew Zaborowski
f6cec3b584
iwd: Let IWD handle retries
When we're set to let IWD control autoconnect, don't retry connections
on NM side, set retry count to 0.
2022-08-24 20:44:45 +02:00
Andrew Zaborowski
e384ab74c2
iwd: Be extra careful not to interrupt assumed activation
The IWD backend would originally use .Disconnect() on IWD dbus "Station"
objects to make sure IWD is out of autoconnect or that it isn't
connecting to a network that NM didn't command.  Later the default became
to let IWD run autoconnect so now most of the time the backend just
mirrors IWD's state to NMDevice's state.

Now sometimes when NMDevice still seems to have an active connection but
IWD has gone through one or more state changes (which we may see after a
delay due to D-Bus) and is now connected to or connecting to a different
network, NMDevice would first have to go through .deactivate to mirror
the fact the original connection is no longer active, and it'd use
.Disconnect() which could break the new connection, so check for this
situation.
2022-08-24 20:44:45 +02:00
Thomas Haller
cbc2354854
wifi: drop duplicate include in "nm-device-wifi-p2p.c"
Base-on-patch-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
2022-08-24 20:37:27 +02:00
Thomas Haller
cfe44c8832
gitlab-ci: fix preserving build artifacts and documentation pages
Without it, the build artifacts were deleted before getting archived.
It means, the tarball and the docs were no longer archived and no
pages on gitlab no longer updated.

Fixes: e118276296 ('gitlab-ci: run unit tests for git subtree subprojects')
2022-08-24 15:54:42 +02:00
Thomas Haller
f7e484c8ed
tests: fix "test-client.py" ignoring missing "NM" module
Fixes: 8959083784 ('tests: skip test in "test-client.py" if the pexepect dependency is not available')
2022-08-24 14:01:07 +02:00
Thomas Haller
90b267afa7
contrib: add "--fast" flag to nm-core-format.sh to only check changed files
It's not the default, because a caller might not be aware that this flag
exists, and when calling the script without arguments, it should do
correct (albeit slow) thing.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1341
2022-08-24 12:06:34 +02:00
Ana Cabral
dc01d353aa NEWS: update 2022-08-24 10:58:23 +02:00
Thomas Haller
8959083784
tests: skip test in "test-client.py" if the pexepect dependency is not available 2022-08-23 15:42:43 +02:00
Thomas Haller
f27b11dd3f
contrib: install Polish translation in "nm-in-container.sh"
It's needed for the unit tests to test translations too.
2022-08-23 15:42:42 +02:00
Thomas Haller
0e26203e02
libnm: reword documentation for "ipv4.gateway" and "ipv6.gateway" 2022-08-23 14:55:41 +02:00
Ana Cabral
711f69fb73 release: bump version to 1.41.0 (development) 2022-08-15 18:18:45 -03:00
Ana Cabral
b2a6b9fcc7 release: bump version to 1.39.90 (1.40-rc1) 2022-08-15 18:13:18 -03:00
Ana Cabral
28282eb1d5 NEWS: update 2022-08-15 17:38:13 -03:00
Ana Cabral
14dabb7b1f po: make update-po
$ make -C po update-po
2022-08-11 19:54:42 +00:00
Thomas Haller
ad1bf3c544
systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1333
2022-08-11 21:51:58 +02:00
Thomas Haller
082e6c96a1
bulid: merge branch 'th/autotools-fix-detect-compiler-warning'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1334
2022-08-11 19:51:11 +02:00
Thomas Haller
4ed6c647b9
build/autotools: fix detecting compiler warning for "-Wno-gnu-variable-sized-type-not-at-end" 2022-08-11 19:50:09 +02:00
Thomas Haller
119d30145e
m4: add NM_COMPILER_WARNING_FLAG() macro
We used

  COMPILER_FLAG(LIBSYSTEMD_NM_CFLAGS, "-Wno-gnu-variable-sized-type-not-at-end")

to detect whether the flag is supported. However, that does not work with GCC since
version 4.4 due to https://gcc.gnu.org/wiki/FAQ#wnowarning.

Note that we already had NM_COMPILER_WARNING(), but that again does
something rather different.
2022-08-11 19:49:41 +02:00
Thomas Haller
3117198f15
Revert "wifi: support "802-1x.phase1-auth-flags=tls-allow-unsafe-renegotiation" flag"
There is still no agreement, about how to name this option, or whether
it should exist at all. Revert the addition of the flag.

As the new release is coming up, drop the new API.

https://bugzilla.redhat.com/show_bug.cgi?id=2072070#c64
https://bugzilla.redhat.com/show_bug.cgi?id=2077973#c24
http://lists.infradead.org/pipermail/hostap/2022-July/040665.html

This reverts commit a5a4aea2e6.
2022-08-11 19:36:26 +02:00
Thomas Haller
c99503abc4
NEWS: update 2022-08-11 15:36:03 +02:00
Thomas Haller
4b0f4f4a9d
n-dhcp4: re-import git-subtree for 'src/n-dhcp4'
git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
2022-08-11 14:47:04 +02:00
Thomas Haller
3d474037ad Squashed 'src/n-dhcp4/' changes from 7db7dc4bab53..f8fc48dc014d
f8fc48dc014d n-dhcp4-client: check broadcast_mac field in n_dhcp4_client_config_set_broadcast_mac()

git-subtree-dir: src/n-dhcp4
git-subtree-split: f8fc48dc014d016f91c200a81b1208410b1cd667
2022-08-11 14:47:04 +02:00
Thomas Haller
cbf7b3546b
platform: fix "maybe-uninitialized" warning in nmp_global_tracker_sync()
Fixes: 3a8864a585 ('platform: delete conflicting route/rule during nmp_global_tracker_sync()')
2022-08-11 13:48:39 +02:00
Fernando Fernandez Mancera
003eb75eb6 bond: fix parsing of arp_ip_target to platform
nm_setting_bond_get_option_normalized() is returning the arp_ip_target
IPs separated by comma instead of a blank space.

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

Fixes: e064eb9d13 ('bond: use netlink to set bond options')
2022-08-11 12:41:59 +02:00
Thomas Haller
7c0de1517c
systemd: update code from upstream (2022-08-10)
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=e8d0eb3915ac33cc0d3da87a836cee6e61645227

(
  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-08-11 10:12:02 +02:00
Thomas Haller
305f02a912
contrib: set short DHCP lifetime in "nm-env-prepare.sh" script 2022-08-10 15:34:43 +02:00
Thomas Haller
540112e36f
contrib: install tcpdump with "nm-in-container.sh"
It's useful for testing, which is what "nm-in-container.sh" is supposed
to provide. It's also only half a megabyte, so reasonably small to
install.
2022-08-10 15:26:41 +02:00
Thomas Haller
f14bb2d7b6
contrib: set fixed MAC address in "nm-env-prepare.sh" script 2022-08-10 15:22:11 +02:00
Thomas Haller
d8419a9611
platform: fix logging of link removed signal
The removed signal did not log the interface name.
That's because _LOG3D() takes the ifindex and looks into the platform
cache to find the interface name. However, if the link is already
removed, it won't find it.

Fix that by explicitly using the right name.

Before:

  <debug> [1660070838.2976] platform: signal: link removed: 602: testX6 <DOWN;broadcast,multicast> mtu 1500

Now:

  <debug> [1660070838.2976] platform: (testX6) signal: link removed: 602: testX6 <DOWN;broadcast,multicast> mtu 1500
2022-08-10 12:47:16 +02:00
Thomas Haller
4dbded903f
platform: fix NMLOG_COMMON() macro to use level argument 2022-08-10 12:46:24 +02:00
Thomas Haller
219dfea425
platform: make NMLOG_COMMON() macro safer by adding a do{}while(0) block 2022-08-10 12:25:16 +02:00
Thomas Haller
1f5a05150a
mptcp: fix nmp_global_tracker_sync_mptcp_addrs()
- drop unused "keep_deleted" parameter. It just doesn't make sense.
  Even less sense than for rules/routes, where this was taken from.

- fix nmp_global_tracker_sync_mptcp_addrs() to delete addresses
  with conflicting flags. We did not correctly delete existing
  addresses, that were to be reconfigured with different flags.

Fixes: 5374c403d2 ('platfrom: handle MPTCP addresses with NMPGlobalTracker')
2022-08-10 11:35:28 +02:00
Thomas Haller
9f0f8e0fbe
config: support hex and octal numbers in nm_config_data_get_connection_default_int64()
This affects parsing global connection defaults from
"NetworkManager.conf".

Let's use a zero base for strtoll(), which honors the prefixes
"0x" and "0" to use hex and octal numbers, respectively. Otherwise
it uses decimal (base 10).

This causes very little ambiguity, but it makes certain numbers
just work.

Also, we have flags properties, where it makes much more sense
to write them in hex, like `connection.mptcp-flags=0x52`.
2022-08-10 10:05:16 +02:00
Thomas Haller
6fb11dbe77
device: allow reapplying changes to "connection.autoconnect-priorty"
Of course, this setting has no effect while being activated. But it
should not prevent reapply.
2022-08-09 14:11:55 +02:00
Thomas Haller
55421209e2
man: show example how to enable logging in NetworkManager 2022-08-09 10:20:58 +02:00
Thomas Haller
6f957f2ef8
NEWS: update 2022-08-09 09:00:52 +02:00
Thomas Haller
a5cbd700d3
mptcp: merge branch 'th/mptcp-2'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1315
2022-08-09 08:06:11 +02:00
Thomas Haller
f64dff6939
all: drop various NMMptcpFlags
The default behavior might be sufficient. Drop those flags for now,
and figure out a good solution when we have an actual use-case.
2022-08-09 08:02:56 +02:00
Thomas Haller
eb083eece5
all: add NMMptcpFlags and connection.mptcp-flags property 2022-08-09 08:02:54 +02:00
Thomas Haller
5374c403d2
platfrom: handle MPTCP addresses with NMPGlobalTracker
When we configure MPTCP addresses, we usually do so per interface
(ifindex). That is, because each interface (via NMDevice and NML3Cfg)
decides how to configure MPTCP, and then we always add MTCP addresses
for this certain ifindex.

With that, we could have a purely interface-specific view and not a
global sync method. However, there are two problems:

The minor problem is that we don't cache the endpoints (because we don't
get notifications). We can only get a dump of all endpoints. It seems
odd to have a mptcp-addr-sync method that is per-ifindex, when it needs
to dump all addresses.

The much more important reason is that the number of endpoints that we
can configure in kernel is very limited. So we need to make a choice
which endpoints to configure, and for that we need to holistic view that
NMPGlobalTracker has.
2022-08-09 08:02:52 +02:00
Thomas Haller
ce635c4339
platform: add dump/update function for MPTCP addresses
Since the generic netlink API does (currently) not support notifications
about changes of the MPTCP addresses, we won't get notifications when
they change, and it seems wrong to put such things in the NMPlatform
cache.

We can just get the list of endpoints by polling, so add a function
nm_platform_mptcp_addrs_dump() for that.

Also, add nm_platform_mptcp_addr_update() which can add/remove/update
MPTCP addresses.
2022-08-09 08:02:50 +02:00
Thomas Haller
ec64559caa
platform: add hash functions for NMPlatformMptcpAddr instances
We already have two hash functions for MPTCP addresses:
nmp_object_id_hash*() which compares the identity of objects
and nm_platform_mptcp_addr_hash*(), which compares all fields.

There is also a need to hash only the address. Add it. Will be used
next.
2022-08-09 08:02:49 +02:00
Thomas Haller
3a8864a585
platform: delete conflicting route/rule during nmp_global_tracker_sync()
The ID of an object does not entail all properties/attributes.
During sync, if we already have an object with the same ID configured,
it may still differ in other aspects.

Handle those cases, by deleting such routes/rules before adding the
desired object.
2022-08-09 08:02:47 +02:00