Commit graph

33604 commits

Author SHA1 Message Date
Wen Liang
883399606f l3cfg: never retry ACD on NOARP interfaces
After upgrading to RHEL-9.4, customers have reported that `ip monitor`
repeatedly logs the same route additions every 30 seconds. This issue
appears to stem from NetworkManager continually retrying to add the same
routes due to keep retrying Address Conflict Detection (ACD) on NOARP
interfaces.

To prevent unnecessary route additions and reduce log noise, this change
modifies NetworkManager's behavior to stop retrying ACD on interfaces
with the NOARP flag.

This fix addresses route instability and excessive logging for affected
NOARP configurations.

https://issues.redhat.com/browse/RHEL-59125
2024-11-15 13:46:37 +00:00
Beniamino Galvani
eb620e0e7e platform: fix to_string() functions for IPv6 tunnels
We can hit an assertion at trace log level when printing IPv6 tunnel
links, because the buffer for the local and remote addresses is not
big enough. Increase the buffer size.

Fixes: 32f6e1ef2e ('platform: add IP6TNL links support')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2063
2024-11-14 09:57:26 +01:00
Íñigo Huguet
4b65e716c8 release: bump version to 1.51.4 (development) 2024-11-13 15:21:42 +01:00
Íñigo Huguet
03ff197b96 ci: fix test failures on non Fedora distros 2024-11-12 15:38:17 +01:00
Íñigo Huguet
b33882e57f merge: branch 'ih/glci-testlog-artifact'
CI: various improvements

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2048
2024-11-11 15:22:47 +00:00
Íñigo Huguet
9a35007bac ci: allow to manually select the Fedora version for Tier 1
Versions that has branched out from Rawhide but are still not released
still have many changes that breaks the CI.

As we want the CI to be more stable for Tier 1, which runs for every MR,
do not make the switch as soon as Rawhide has branched, but when we choose so.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
9354fabaa8 ci: Update ci-templates to a version that support Alpine versions
ci-templates only supported alpine:latest, but support for any other
version has been introduced. Use it so our Alpine pipelines stop
failing.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
7cef59c503 ci: rename function in run-test.sh for clarity
I always struggle to understand what 'check_run' means, as it suggests
that the run is executed and the results checked. What it acutally does
is to check if the run passed as argument is selected. Rename to
is_run_selected.

Also, remove check_run_clean which was only a check_run + do_clean. Just
call directly to do_clean.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
0d4c8a235a CI: add testlog.txt as build artifacts
That way we will be able to check the logs in the case of failure.
2024-11-11 13:55:23 +01:00
Beniamino Galvani
23ffa5fc6e core: increase timeout for test_nm_utils_kill_child()
The test starts a watchdog process that eventually kills the process
group after a certain time. When running under valgrind concurrently
to other tests the current timeout is not enough; increase it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2067
2024-11-08 17:32:09 +01:00
Beniamino Galvani
2932825952 device: support IPv6 EUI64 link-local address for ipv6 tunnels
Currently, if a IPv6 tunnel device is configured to use an EUI64
link-local address (via per-connection or global configuration), the
IPv6 configuration fails because NM cannot determine an interface
identifier.

Generate the interface identifier use the same mechanism [1] as
kernel, which relies on the fake "permanent" address and treats the
interface as Ethernet.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/addrconf.c?h=v6.11#n2364

Fixes-test: @iptunnel_ip6gre_create_device

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2065
2024-11-08 17:30:06 +01:00
Luna D Dragon
40c187dc15 build: allow building with clang+lto
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2053
2024-11-08 10:21:33 +01:00
Tim Sabsch
fd1a5b3c4b i18n: Update German translation
Fixes a translation issue where teaming and bonding were both translated
als "gebündelt". Proof-read at https://l10n.gnome.org/vertimus/695/379/18/

https://gitlab.gnome.org/Teams/Translation/de/-/issues/8
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2064
2024-11-08 10:15:22 +01:00
Beniamino Galvani
6a2fcfc6b5 merge: branch 'fec'
ethtool: support Forward Error Correction(fec)

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1895
2024-11-07 14:58:08 +00:00
Gris Ge
19bed3121f ethtool: support Forward Error Correction(fec)
Introducing support of ethtool FEC mode:

D-BUS API: `fec-mode: uint32_t`.
Keyfile:

```
[ethtool]
fec-mode=<uint32_t>
```

nmcli: `ethtool.fec-mode` allowing values are any combination of:
 * auto
 * off
 * rs
 * baser
 * llrs

Unit test cases included.

Resolves: https://issues.redhat.com/browse/RHEL-24055

Signed-off-by: Gris Ge <fge@redhat.com>
2024-11-07 17:38:04 +08:00
Wen Liang
0bac01b133 merge: branch 'wl/ip_ping_target'
connection: Support ip-ping-target and ip-ping-timeout

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2034
2024-11-06 12:51:46 +00:00
Wen Liang
658aef0fa1 connection: Support connection.ip-ping-addresses
We have encountered multiple incidents where users face connectivity
issues after booting, particularly due to hardware like switches that do
not pass traffic for a few seconds after startup. And services such as
NFS fail to mount because they try to initiate before the network is
fully reachable. Therefore, we are supporting
`connection.ip-ping-addresses` and `connection.ip-ping-timeout` to
allow administrators to configure the network to verify connectivity to
a specific target(such as a service like NFS) instead of relying on
gateway reachability, which may not always be relevant in certain
network configurations.

Resolves: https://issues.redhat.com/browse/RHEL-21160
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2034
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1797
2024-11-05 14:04:26 -05:00
Wen Liang
f967074521 nm-device: add log indicating gateway ping started
Since we are adding the ping check for the connection.ip-ping-addresses,
it makes more sense to improve the logging to differentiate between the
started ping operations for gateway and connection.ip-ping-addresses.
2024-11-05 13:55:18 -05:00
Valentin Blot
4082e7e109 wwan: remove buggy assertion
Removed an assertion that was not satisfied in the legitimate case of
IPv4 + do_auto.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2061
2024-11-05 11:17:34 +01:00
Beniamino Galvani
1e373ae073 merge: branch 'bg/print-config'
Print the path of internal configuration file with `NetworkManager --print-config`

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2026
2024-11-04 16:09:40 +00:00
Beniamino Galvani
2844b205ab core: print the internal configuration file with "--print-config"
When there is a non-empty internal configuration file, print it in the
output of "NetworkManager --print-config".

Before:
  NetworkManager --print-config:
  # NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf, /usr/lib/NetworkManager/conf.d/{00-server.conf,22-eth-mac-addr.conf}
  ...

After:
  NetworkManager --print-config:
  # NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf, /usr/lib/NetworkManager/conf.d/{00-server.conf,22-eth-mac-addr.conf}, /var/lib/NetworkManager/NetworkManager-intern.conf
  ...

Tests needs to be changed because now writing to the internal file
causes a change of the description of the NMConfigData and therefore
the NM_CONFIG_CHANGE_CONFIG_FILES flag is set.
2024-11-04 17:04:52 +01:00
Beniamino Galvani
07113dde30 core: fix deleting internal global DNS configuration
The tracking of variable "has_intern" in intern_config_read() is
wrong: we set it when adding any entry to the keyfile, but then we
remove the global DNS section without updating the variable.

The effect is that the function might return an empty keyfile instead
of NULL.

Fix this by moving the check on global DNS above.

Fixes: 55c204b9a3 ('core: add support for reading global DNS configuration from keyfile')
2024-11-04 17:04:51 +01:00
Beniamino Galvani
40ac7b1406 core: print full configuration paths with "--print-config"
In the output of "NetworkManager --print-config" we currently print
the list of configuration snippets in an abbreviated form:

  ... (lib: 00-server.conf, 22-wifi-mac-addr.conf) (etc: 08-unmanaged.conf)

While it is concise and unambiguous, it can be cryptic for
users. Instead, print the full paths:

  ... /usr/lib/NetworkManager/conf.d/{00-server.conf,22-wifi-mac-addr.conf}, /etc/NetworkManager/conf.d/{08-unmanaged.conf}
2024-11-04 17:04:51 +01:00
Wen Liang
da014fb148 merge: branch 'wl/update_spec'
spec: add iputils as runtime dependency for ping command

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2058
2024-11-04 15:03:10 +00:00
Wen Liang
7ab3362940 spec: add iputils as recommended dependency for ping command
NetworkManager relies on the ping command provided by `/usr/bin/ping`
from the iputils package to proceed the gateway or ip addresses
connectivity check.  This change ensures that iputils is recommended as a
dependency, making the ping command available for use during runtime but
not enforcing its installation as mandatory since NM can still proceed
to activate the connection even if the ping operation failed.
2024-11-04 14:25:54 +00:00
Fernando Fernandez Mancera
984d56e6f6 release: bump version to 1.51.3 (development) 2024-10-31 15:23:59 +01:00
Andika Triwidada
079a754b1e libnmc/client-utils: typo fix, add closing parenthesis
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2059
2024-10-30 11:05:50 +01:00
Lubomir Rintel
f2a01782a3 test/check-systemd-unit: skip if systemd too old
On RHEL 8, the --offline argument is not yet there.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2060
2024-10-30 11:04:36 +01:00
Wen Liang
afab26a8fa merge: branch 'global_dhcp_hostname_flags'
device: Support configuring dhcp-send-hostname globally

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2029
2024-10-28 13:45:11 +00:00
Wen Liang
fb56168524 keyfile: convert dhcp-send-hostname <-> dhcp-send-hostname-v2 during settings read and write
To have a consistent setting name conversion between
`dhcp-send-hostname` and `dhcp-send-hostname-v2` with nmcli and global
config, convert dhcp-send-hostname <-> dhcp-send-hostname-v2 during
keyfile settings read and write.
2024-10-24 17:03:10 -04:00
Íñigo Huguet
380458b0ee ip-config: Fix the nmcli docs for the renamed dhcp-send-hostname
In nmcli we have renamed dhcp-send-hostname and dhcp-send-hostname-v2 to
dhcp-send-hostname-deprecated and dhcp-send-hostname so users don't need
to worry about the details of the weird workarounds that we sometimes
need to do to expand and/or deprecate some properties.

However, the autogenerated documentation didn't include this names. Add
---nmcli--- specific documentation, adding a new property-infos field
called "rename" with the new name used in nmcli. This field can be used
for more properties if we use the same strategy in the future.
2024-10-24 17:03:10 -04:00
Wen Liang
add4dad505 nmcli: convert everywhere dhcp-send-hostname <-> dhcp-send-hostname-v2
Since introducing the setting ipv[46].dhcp-send-hostname-v2 internally
in NM for supporting global default behavior of DHCP send hostname,
confusion arises for setting the dhcp-send-hostname-v2 and old
dhcp-send-hostname in nmcli. To avoid any confusion from user
configuring dhcp-send-hostname-v2 and old dhcp-send-hostname using
nmcli, introduce the mapping from nmcli argument dhcp-send-hostname to
internal dhcp-send-hostname-v2 property and the mapping from nmcli
argument dhcp-send-hostname-deprecated to internal old dhcp-send-hostname
property.

The change in split_required_fields_for_con_show makes that properties
specified with -g or -f are converted to the libnm's "internal" names.

The change in _print_fill makes that the names are converted to the
"external" user facing names.
2024-10-24 17:03:10 -04:00
Wen Liang
51ea910cc2 device: Support configuring dhcp-send-hostname globally
The user does not want to send machine hostname to the DHCP server
globally by default to avoid ddns record getting created in IPAM.
otherwise, IPAM creates ddns records which might interfere with user's
regular host record. Thus, introduce the ternary property
dhcp_send_hostname_v2 to warrant this behavior.

Notice that we set the GSpec of dhcp-send-hostname-v2 to int, because
defining it as enum would make that it cannot be expanded in a backwards
compatible way if we need to add more values: old clients using libnm
would reject it due to the new value being unknown. Follow the same
strategy than _nm_setting_property_define_direct_enum, defining the
NMSettInfoPropertType as enum, but the glib's GSpec as int.

Resolves: https://issues.redhat.com/browse/RHEL-56565
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2029
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1765
2024-10-24 17:03:10 -04:00
Íñigo Huguet
2bbedbcf7d merge: branch 'ih/nmcs-oci'
cloud-setup: Add OCI (Oracle Cloud) provider

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2056
2024-10-24 14:16:23 +00:00
Íñigo Huguet
4024e5c612 cloud-setup: Add OCI (Oracle Cloud) provider
Initial support for OCI. It doesn't support VLAN configuration yet as
the requirements are not clear. It doesn't support secondary IP
addresses because the IMDS server doesn't expose them.

Instead of using plain text format, it gets a single response in JSON
format and parses it. The dependency to jansson is now mandatory for
that.
2024-10-24 16:14:48 +02:00
Beniamino Galvani
e4c3d46572 merge: branch 'bg/dns-routes'
Support automatically adding DNS routes

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

https://issues.redhat.com/browse/RHEL-56555
2024-10-23 13:45:29 +00:00
Beniamino Galvani
967fed4982 NEWS: update 2024-10-23 15:38:37 +02:00
Beniamino Galvani
5449b18a94 core: support automatically adding DNS routes
When the "ipvX.routed-dns" property is set to true, add a route for
each DNS server via the current interface. The feature works in the
following way.

A new routing rule is created ("priority $PRIO not fwmark $MARK lookup
$TABLE") where $PRIO, $MARK and $TABLE are fixed values and are the
same for all interfaces. This rule is evaluated before standard rules
and tries to look up routes in table $TABLE, where NM adds the routes
to DNS servers.

To determine the next-hop to the name server, NM issues a RTM_GETROUTE
netlink request to kernel, specifying to return the route via the
current interface. In order to avoid results from $TABLE, NM also sets
the fwmark as $MARK in the request.
2024-10-23 15:38:36 +02:00
Beniamino Galvani
5122ba48ef l3cfg: add flag 'routed-dns' to NML3ConfigData 2024-10-23 15:38:35 +02:00
Beniamino Galvani
4e37e4c614 device: remove 'const' qualifier from function signature
nm_device_create_l3_config_data_from_connection() returns an unsealed
NML3ConfigData that can still be modified afterwards.
2024-10-23 15:38:34 +02:00
Beniamino Galvani
0e5815ba84 libnm: add new property "ipvX.routed-dns" 2024-10-23 15:38:33 +02:00
Beniamino Galvani
45535cbf9f platform: support specifying the fwmark in ip_route_get()
Add an optional argument to specify the fwmark, which will be used in
the next commits to return results that match a specific rule.
2024-10-23 15:06:59 +02:00
Beniamino Galvani
5c075eb762 device: emit the "l3cd-changed" signal after commit
I think the current semantics of the NMDevice's "l3cd-changed" signal
is not useful, as it reports that the layer-3 configuration changed
before it is committed to platform.

In this way, the only current subscriber (NMPolicy), reacts to the
change too early: it updates the DNS servers in the system when the
interface doesn't have yet addresses and routes ready. Therefore, the
resolver (libc, systemd-resolved, ...) will try to contact the DNS
server using the wrong parameters.

Change the semantics so that the signal is emitted *after* the commit
to platform.
2024-10-23 15:06:59 +02:00
Beniamino Galvani
3eb45c1d40 l3cfg: simplify signals
During a commit of layer-3 configuration, multiple signals are
emitted:

 - if the combined l3cd configuration changes, we first emit a
   L3CD_CHANGED signal, with flag `commited` FALSE;
 - if the previously committed configuration is different from the one
   we want to commit, we emit again the same signal with `commited`
   TRUE;
 - a PRE_COMMIT signal
 - a POST_COMMIT signal

The usefulness of the first and third signals is questionable: there
is no need to signal that the configuration changes if we are not
going to commit it. Also, PRE_COMMIT is redundant as we just emitted
L3CD_CHANGED. Nobody is using those 2 signals.

Simplify this by leaving only PRE_COMMIT and POST_COMMIT, which are
always emitted during a commit and provide information on the l3cd
changes.

This commit doesn't change behavior.
2024-10-23 15:06:58 +02:00
Beniamino Galvani
3e93134c04 checkpatch: silence warning about direct properties for the IP setting
Since NMSettingIPConfig is an abstract type that cannot be
instantiated, the overrides for the direct properties are defined on
the subclasses (NMSettingIP4Config and NMSettingIP6Config).

Silence the warning about using direct properties.
2024-10-23 15:06:58 +02:00
Beniamino Galvani
d6684269fa merge: branch 'bg/dhcpv4-ipv6-only'
Add support for the "IPv6-Only Preferred" DHCPv4 option

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

https://issues.redhat.com/browse/RHEL-58660
2024-10-23 13:04:12 +00:00
Beniamino Galvani
fe1a1b39d4 NEWS: update 2024-10-23 15:01:21 +02:00
Beniamino Galvani
2c373ec9ed dhcp: allow changing MIN_V6ONLY_WAIT via environment variable
When performing integration tests for the IPv6-only DHCP option, we
want to test that the option is honored and that NM restarts DHCP if
the option goes away. However, the minimum wait time according to the
RFC is 5 minutes, which makes the test take long time.

Allow changing the value via the "NM_TEST_IPV6_ONLY_MIN_WAIT"
environment variable.
2024-10-23 15:01:20 +02:00
Beniamino Galvani
03c01eae29 device: configure IPv6-only-preferred mode in the DHCP client
Configure the DHCP client to enable the IPv6-only-preferred mode based
on the content of the profile and on global configuration.
2024-10-23 15:01:20 +02:00
Beniamino Galvani
022b7ac184 dhcp: support the IPv6-Only Preferred option
Add support for handling the IPv6-Only Preferred option. When enabled,
the client adds the option code to the "Parameter Request List" option
of the DHCPDISCOVER and DHCPREQUEST messages. If the server sends the
option back in the DHCPOFFER and DHCPACK, the host stops the DHCP
client for the time interval specified in the option. After the
timeout expires, DHCP is restarted.
2024-10-23 15:01:19 +02:00