Commit graph

32606 commits

Author SHA1 Message Date
Beniamino Galvani c3ca0b90cd contrib/rpm: ship a different readme when ifcfg migration is enabled
Ship a different file in /etc/sysconfig/network-scripts to warn that
migration is enabled.
2023-10-03 14:09:21 +02:00
Korbin Bickel 8f438d8d08 wifi: add 6ghz device capability flag
Adds a new WiFi 6GHz capability flag, NM_WIFI_DEVICE_CAP_FREQ_6GHZ,
along side the existing NM_WIFI_DEVICE_CAP_FREQ_2GHZ &
NM_WIFI_DEVICE_CAP_FREQ_5GHZ flags.

Gnome settings utilizes the 2 existing flags to present supported
bands in gnome-settings. I will be using this additional flag in
modifications there.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1739
2023-10-03 08:28:58 +02:00
Beniamino Galvani fa1239df14 merge: branch 'jv/no-pid-upper-bound'
main: increase upper limit of pid when checking pidfile

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727
2023-10-03 06:25:41 +00:00
Jan Vaclav 50f34217f9 main: use _nm_utils_ascii_str_to_int64 instead of strtol for reading pid
Also removes the errno check, since it's already done within _nm_utils_ascii_str_to_int64()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727
2023-10-03 06:25:18 +00:00
Jan Vaclav 28f7a6638f main: don't limit upper bound of pid when checking pidfile
This commit removes the upper bound check for the PID, letting NetworkManager recognize a PID from the pidfile higher than 2^16.
The PID limit is often set higher than 2^16 (65536) on 64-bit systems, resulting in the pidfile being ignored and subsequently deleted if the currently running instance of NetworkManager has a pid higher than 2^16.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727
2023-10-03 06:25:18 +00:00
Wen Liang ffc377ecc6 device: negate the condition in _get_maybe_ipv6_disabled
The condition in `_get_maybe_ipv6_disabled()` is improperly set which
returns the wrong value on if an device is disabled or not when
generating the assume connection. And when
`/proc/sys/net/ipv6/conf/$DEV/disable_ipv6` is not existed (not
disabling ipv6 through sysctl setting), IPv6 is disabled by default.

Fixes: be655e6ed1 ('core: read "disable_ipv6" sysctl before nm_ip6_config_create_setting()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1743
2023-10-02 15:57:35 -04:00
Beniamino Galvani e85b76b736 merge: branch 'wip/sadiq/qr-border'
libnmc-base/utils: Improve qr code bottom border

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1736
2023-10-02 15:58:31 +00:00
Mohammed Sadiq d9b06a95c9 libnmc-base/utils: Improve qr code bottom border
The bottom border of the generated QR code had a different thickness
compared to other borders.

Improve it by using Upper Half Block so that all borders have similar
thickness.
2023-10-02 15:57:41 +00:00
Beniamino Galvani 9820e791d1 merge: branch 'ungateway-ofono'
wwan/ofono: handle missing default gateway

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1731
2023-10-02 13:27:36 +00:00
Sicelo A. Mhlongo 96ae8b794f wwan/ofono: handle missing default gateway
It is normal for the operator to not provide a default gateway address, in
which case it must be set to 0.0.0.0, as can be seen in upstream ofono test
scripts [1].

[1] https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/test/process-context-settings?id=945a621a2ddfc01b8bdd8936044cb7d2604e8608

Fixes: a6e81af87f ('wwan: add support for using oFono as a modem manager')
2023-10-02 13:25:48 +00:00
Gris Ge 1486c78b13 merge: branch 'dns_changed_event'
dispatch `dns-change` dispatcher event

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1732
2023-09-28 00:17:51 +00:00
Gris Ge a1db61ebc9 dispatch dns-change dispatcher event
Introducing new dispatcher event -- `dns-change` which will be emitted when
DNS configuration changed(even in `dns=none` mode). This is to solve two
use cases:
 * Invoke dispatch script for DNS changes triggered by the global DNS
   API.

 * Do not invoke [OpenShift resolv-prepender][1] for non-DNS changes.

Bug reference: https://issues.redhat.com/browse/RHEL-1671

[1]: https://github.com/openshift/machine-config-operator/blob/master/templates/common/on-prem/files/resolv-prepender.yaml

Signed-off-by: Gris Ge <fge@redhat.com>
2023-09-26 17:14:58 +08:00
Gris Ge a847ba8075 emit DNS CONFIG_CHANGED signal even dns=none
Instruct the `NMDnsManager` to emit `CONFIG_CHANGED` signal even
`dns=none` or failed to modify `/etc/resolv.conf`.

The `NMPolicy` will only update hostname when DNS is managed.

Signed-off-by: Gris Ge <fge@redhat.com>
2023-09-26 15:00:32 +08:00
Aleksandr Melman 390269807f Update Russian translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1740
2023-09-25 14:21:25 +02:00
Beniamino Galvani 16f667bf2d merge: branch 'remove_csme'
platform: remove CSME related code

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1573
2023-09-25 11:47:39 +00:00
Emmanuel Grumbach 3476135911 platform: remove CSME related code
Remove all the code that was added for the CSME coexistence.
The Intel WiFi team can't commit on when, if at all, this feature will
be completely integrated and tested in the NetworkManager.
The preferred solution for now is the solution that involves the kernel
only.
Remove the code that was merged so far.
2023-09-25 11:46:24 +00:00
Beniamino Galvani 673f9d2154 merge: branch 'th/clicolor-force'
Support CLICOLOR_FORCE variable and fix handling of empty NO_COLOR

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1733
2023-09-25 09:03:28 +00:00
Thomas Haller ae06a607b3 cli: honor CLICOLOR_FORCE= variable to enable colors with nmcli
Note that [1] suggests to also accept an empty value as having the variable
set. That is likely a bug ([2]) in the documentation, makes little sense, and
is not the case with NO_COLOR ([3]).

[1] https://bixense.com/clicolors/
[2] https://github.com/jhasse/clicolors/issues/13
[3] https://no-color.org/
2023-09-25 09:02:17 +00:00
Thomas Haller 0ac5221c40 cli: fix handling empty NO_COLOR= variable
An empty value NO_COLOR= should not be treated to disable colors.
This is also what [1] says (changed a while ago [2]).

[1] https://no-color.org/
[2] 99f90e27d0
2023-09-25 09:02:17 +00:00
Beniamino Galvani 867db80457 merge: branch 'fm/1354-assert-modem-device'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1726
2023-09-25 08:49:34 +00:00
Frederic Martinsons 2d85b11660 devices/wwan: don't assert on unexpected state
On very particular timing, if a connection is currently activating
on a modem device and user remove the remote settings associated
an device state change:

prepare -> deactivating (reason 'connection-removed', sys-iface-state: 'managed')

pops before entering into modem_prepare_result, resulting to a crash
on assertion.

We can simply check for the modem state to failed, set the success flag
to FALSE and continue.

Closes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1354

Signed-off-by: Frederic Martinsons <frederic.martinsons@unabiz.com>
2023-09-25 08:48:25 +00:00
Beniamino Galvani 07b46b7873 release: bump version to 1.45.3 (development) 2023-09-22 13:58:50 +02:00
Íñigo Huguet fcfbbb9a32 Fix version error when building with an old meson version
Addition of list and string is allowed but only from version 0.60 of
meson. We claim to support building with meson 0.47, and there are
distributions like Debian and CentOS Stream 8 that uses versions older
than 0.60. Fix it by converting the offending string to a single item
list.

On newer versions, we get this warning only:
  Project targets '>= 0.47.2' but uses feature introduced in
  '0.60.0': list.<plus>. The right hand operand was not a list.

Fixes: 984642e33f ('build: meson: fix some missing dependencies')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1737
2023-09-22 10:34:24 +02:00
Íñigo Huguet 4ad4a1fbeb nm-meta-setting-desc: refactor and comment when get_gtype is disallowed
The get_gtype field in property_typ_data is intended to specify an enum
type for properties that are really defined as (u)int in the NMSetting
class. Specifying get_gtype for properties that are already defined as
enum in the NMSetting class is rejected as a runtime error. However, the
error message doesn't explain the reason. Put a code comment explaining
the reason.

Explaining it in a comment is actually enough because:
- The error is a runtime assertion that indicates a programming error
- The assertion is checked any time that the property is read or
  written, so it should always be detected at developing time when doing
  changes to the property.

Anyway, the code that did this checks was very difficult to read, so
let's take the opportunity to refactor it, with no functional changes.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1728
2023-09-21 16:02:15 +02:00
Íñigo Huguet dfe7e0e868 man nm-settings-nmcli: autogenerate info about valid input format and values
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1729
2023-09-21 15:58:11 +02:00
Íñigo Huguet 984642e33f build: meson: fix some missing dependencies
Some targets related to documentation generation had missing
dependencies, like xsl templates or the python generator. If these files
are changed, their output changes too, but as they were not listed as
dependencies (custom_target's input), meson wasn't aware.

In Makefile.am they already were correctly listed as dependencies.
2023-09-21 15:57:35 +02:00
Íñigo Huguet f4fbc59a16 man nm-setting-*: proper format for gtkdoc constants
Gtkdoc comments are used, among other things, to generate the various
nm-setting-* manual pages. When a constant is referenced in a gtkdoc
comment (i.e. `%NM_IP_TUNNEL_MODE_IPIP`) it is expanded to show the C name
and the value (i.e. `NM_IP_TUNNEL_MODE_IPIP (1)`). To generate the
nm-setting-* manual pages, we don't use gtkdoc, but we process this data
with the custom script tools/generate-docs-nm-settings-docs-gir.py.
This script was expanding the constants in the same way than gtkdoc.

Showing the constants in that way in nm-setting-* manual pages makes
little sense, because users are not going to use the C identifiers.
Let's show them with a more appropriate format.

Additionally, the different nm-setting-* pages might require different
formats than the other. For example, for nm-setting-nmcli a format like
`"ipip" (1)` is prefered, but for nm-setting-dbus it's better
`1 (ipip)`. Let's generate different nm-settings-docs-gir-*.xml files for
nmcli, dbus, keyfile and ifcfg-rh, using the right format for each one.
2023-09-21 15:57:35 +02:00
Íñigo Huguet c9ced304d2 man nm-setting-*: add "expand enumvals" capability to property-infos
In some cases, properties documentation might require to provide an
explanation of each of the possible values that the property accepts.
If the possible values are the variants of an enum, we can use the
introspection data to get all the possible values for that enum and
their descriptions. With that info, we can automatically generate the
documentation with an always up to date list of accepted values.

Add a new "expand enumvals" feature: it will convert a token with the
format `#EnumName:*` to a list of all the possible values. For the
docbook (description-docbook field in the XML), it is expanded to a
bulleted list of all the values and their respective documentations.

This feature is limited to the "property-infos" comments (those like
---nmcli---, ---dbus---, etc). This comments are used only to generate
the nm-settings-* manual pages. For the documentation under the doc/
folder this is not needed: it's not supported by gtkdoc and, anyway,
it's better to use just `#EnumName` that will generate an HTML link.

Additionally, expansion of `%ENUM_VALUE` is now supported in the
property-infos comments. Instead of expanding them in the same style
than gtkdoc "ENUM_VALUE (num)", it is expanded in a format more suitable
for the nm-setting-* manual pages:
- for nmcli: value_nick (num)
- others: num (value_nick)

Also, fix typo in meson build file propery -> property.
2023-09-21 15:57:35 +02:00
Íñigo Huguet 5c6ae44e00 man nm-settings-nmcli: add "Special values" field
If there are properties that accept special values apart from the
normally accepted values, or any of those values has an special meaning,
it can be shown as "Special value", indicating the nicknames and numbers
that can be used to select it.
2023-09-21 15:57:35 +02:00
Íñigo Huguet 925d4df801 man nm-settings-nmcli: add "Valid values" field
Show a new field called "Valid values" in those properties that only
accept a limited set of values, like enums, ints with a valid range of
values, etc.

As there is some complex logic behind getting this information, this
logic has been put in nm-meta-setting-desc and nm-enum-utils so they can
be re-used, avoiding duplicity and errors. Some refactor has been done
in nm-meta-setting-desc in this direction, too.
2023-09-21 15:57:35 +02:00
Íñigo Huguet af5c1c8019 man nm-settings-nmcli: autogenerate the "Format" field
Instead of deducing the type from the GLib's types, use the properties'
metadata available in nm-meta-setting-desc.c which is the most accurate
representation of what the expected input from the user is.
2023-09-21 15:57:35 +02:00
Íñigo Huguet 33cc96b137 tools: add nm-in-vm script
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1724
2023-09-21 15:53:46 +02:00
Íñigo Huguet 52c347677f tools: nm-in-vm: fix error if pool folder doesn't exist yet
If libvirt's default pool folder doesn't exist yet (i.e. the user has
never installed a VM there), create it to avoid error and script exit.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 0ec71289ed tools: nm-in-vm: fix motd
Message of the day was shown twice because the same bashrc.my file than
for containers was used. That file contained some code to show motd in
the container, where it is not shown by default. But in the VM, the motd
is shown by default, so it was shown twice.

Move the code to show motd to a file used only by nm-in-container and
not by nm-in-vm.

Also, modify the explanation about using prepare-for-system.sh because
it's only valid for Fedora but nm-in-vm can be used with other SOs too.
2023-09-21 15:53:03 +02:00
Íñigo Huguet c8a329bc12 tools: nm-in-vm: don't allow invalid hostnames, fix regex
The $VM name is used also as hostname in the guest so ssh connection can
be made to root@$VM. However, valid hostnames can only contain letters,
numbers and '-'. If other characters are used, they are removed from the
hostname so you cannot connect to root@$VM. Fix it by not allowing
invalid hostnames in $VM at VM creation.

Also, fix some incorrect bash regexes.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 25e6218e94 tools: nm-in-vm: fix CentOS Stream guest
Install missing repositories required to install all the packages.

Unluckily, it doesn't support 9P filesystem shares, and virtiofs is not
supported for non-root hosts. Emit a warning about that.
2023-09-21 15:53:03 +02:00
Íñigo Huguet f9cfe80b56 tools: nm-in-vm: change default image size
Images of qcow2 format dynamically grow up to the maximum size that they
have been configured at creation time. Because of this, higher size can
be selected without wasting unnecesary space in the host. Rise image
size to 20G.

Also, allow to set an empty value to IMAGE_SIZE, and don't resize in
that case. This is useful because virt-resize fails with some guest
partition layouts (like with ubuntu-20.04).
2023-09-21 15:53:03 +02:00
Íñigo Huguet 28cb8024e3 tools: nm-in-vm add convenience options --vm and os_version
Using more than one VM can be a quite common use case. Insteado of
having to do VM=vm_name ./nm-in-vm, allow the more common way of passing
options ./nm-in-vm --vm vm_name.

Also, in build command, accept one positional argument to set OS_VERSION.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 49175cb2cb tools: nm-in-vm: Debian/Ubuntu with extra pkgs and fixed installation 2023-09-21 15:53:03 +02:00
Íñigo Huguet 2b44baf137 tools: nm-in-vm: fix connectivity with host
The connectivity with the host depends on getting a DHCP lease from the
host. With the latest commit's customizations, the virtual NIC is not
managed by NM so it is not configured.

Keep it unmanaged so debuging NetworkManager doesn't affect to this
virtual NIC. Use dhclient to get a DHCP lease from the host. Assign a
fixed interface name (host_net) to match it from NM and dhclient config
files.
2023-09-21 15:53:03 +02:00
Íñigo Huguet db78d7b1b0 tools: nm-in-vm: add NM custom files, packages and configs
Same packages and customizations than in nm-in-container. Packages for
Debian/Ubuntu pending of being added because they have different names.
2023-09-21 15:53:03 +02:00
Íñigo Huguet d00a5d2a8b tools: nm-in-container: don't generate files from the script
The script was generating the data-* files that later copies to the
container.

In order to the files being reusable for nm-in-vm, put them as separate
files inside the data directory.

However, some of the files need the full path to NetworkManager project,
which varies for each user. Instead, make a sed replacement on them and
generate the actual files that will be copied. Replacement:
{{BASEDIR_NM}} -> $BASEDIR_NM

Also, rename the files to more descriptive names, using some prefixes
that give a hint of where those files will be put, and the .in extension
to indicate that they will be processed.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 3100e4b6e2 tools: nm-in-container: move data to a common path for nm-in-vm
nm-in-vm can use the same generated files than nm-in-container, so let's
move them to a place common for both: tools/nm-guest-data.

With this change, it is not worth it to have the nm-in-container
directory, so move the script to tools and delete the subdirectory.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 97595fb00b tools: add nm-in-vm script
Script to download, configure and install a virtual machine to build and
test NetworkManager. This is useful because there are some things that
doesn't work properly on containers so a VM is needed to test.

It works almost the same way than nm-in-container.

Configurations specific to NetworkManager such as installing the required
packages are not implemented yet.
2023-09-21 15:53:03 +02:00
Íñigo Huguet 4fecd36d9d man: keyfile: improve explanation of the format and routes properties
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1722
2023-09-21 15:50:37 +02:00
Íñigo Huguet 03db294c5c man: keyfile: complete the explanation of routes properties
Complete the explanations of routes properties, adding explanations for
routesN_option and routing-rules.
2023-09-21 15:49:24 +02:00
Íñigo Huguet 9d7644af5f man: keyfile: improve explanation of the format
Separate the explanation of the format in various paragraphs so it is
better structured and easier to follow and understand.

Add a note about the properties that, instead of using a semicolon
separated list, use individual key-value pairs per list element
(addresses, routes and routing-rules), since this is also a relevant
difference from the standard key file format and from the settings
specification format.
2023-09-21 15:49:24 +02:00
Wen Liang 4d0cf4924f device: do not set dependency failed for port if master is reconnecting
When a master is re-enslaved, it will be deactivated and reconnecting
immediately, as a result, we should not set the dependency-failed for
its port. Otherwise, we may risk blocking the autoconnect of port
connections with higher autoconnect-priority.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1725
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1473
2023-09-17 20:39:58 -04:00
Íñigo Huguet 510952b036 contrib: add libpsl-dev to debian requirements
It's installed for Fedora and Alpine, and building with meson requires
it by default.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1723
2023-09-13 16:29:01 +02:00
Beniamino Galvani 349665082f wifi: fix code format
Fixes: 04edba879d ('core: use nm_strerror_native() instead of strerror()')
2023-09-13 11:09:30 +02:00