Commit graph

33386 commits

Author SHA1 Message Date
Beniamino Galvani
777418dfd7 rpm: disable ifcfg support in Fedora 41
https://fedoraproject.org/wiki/Changes/RemoveIfcfgSupportInNM
https://bugzilla.redhat.com/show_bug.cgi?id=2296272
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1985
2024-07-16 14:35:31 +02:00
Gris Ge
83a2595970 activation: Allow changing controller of exposed active connection
When activating a port with its controller deactivating by new
activation, NM will register `state-change` signal waiting controller to
have new active connections. Once controller got new active connection,
the port will invoke `nm_active_connection_set_controller()` which lead
to assert error on
    g_return_if_fail(!nm_dbus_object_is_exported(NM_DBUS_OBJECT(self)))

because this active connection is already exposed as DBUS object.

To fix the problem, we remove the restriction on controller been
write-only and notify DBUS object changes for controller property.

Signed-off-by: Gris Ge <fge@redhat.com>
2024-07-12 17:38:01 +08:00
Beniamino Galvani
a51159f4e8 dhcp: fix indentation
Fixes: bc5d76ca82 ('core/dhcp: adjust client plugin priority')
2024-07-12 11:33:19 +02:00
Lubomir Rintel
3d82b9b318 merge: branch 'lr/deprecate-dhclient'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1988
2024-07-11 15:46:31 +02:00
Lubomir Rintel
d246d9df88 merge branch 'lr/simpler-rpm'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1990
2024-07-11 12:29:26 +02:00
Lubomir Rintel
350ac5acd9 merge: branch 'lr/rpms'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1955
2024-07-11 12:23:12 +02:00
Lubomir Rintel
037450df45 contrib/rpm: remove conditionals for RHEL 7 and older
There's just too much clutter in the SPEC file. Drop some totally
obsolete stuff.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
1ccc1e0041 contrib/rpm: install firewall zone unconditionally
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
954e8c8d64 contrib/rpm: stop conditionalizing default DHCP client
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
811ef6952d contrib/rpm: remove extra 0%{?rhel} from some conditionals
"0%{?rhel} && 0%{?rhel} >= 8" just says 0%{?rhel} twice, redundantly.
Let's not do that.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
c639387071 contrib/rpm: remove ldconfig scriptlets
The file triggers replaced this aeons ago. RHEL 8 definitely has them:

  [root@el8 ~]# rpm -q --filetriggers glibc-common
  transfiletriggerin scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  transfiletriggerpostun scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  [root@el8 ~]#
2024-07-11 12:13:33 +02:00
Lubomir Rintel
c72a52ed36 NEWS: document dhclient deprecation
https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
a2914f1d0a rpm: disable dhclient on Fedora 41 and RHEL 10
They're off by default, but SPEC file turns them on. Don't do that in
future distros.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
05b4610667 man: update dhcp client manual after dhclient deprecation
Reflect the change in priority and deprecation in the manual.
Hopefully make it slightly easier to read along the way.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
3955be817d core/dhcp-manager: warn if dhclient plugin is requested
It's deprecated. Warn any time it is being considered for loading,
instead of at load time, so that the user gets a warning when they got
the plugin in configuration, even if it's build time disabled.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Lubomir Rintel
bc5d76ca82 core/dhcp: adjust client plugin priority
Prioritize internal, which is what most people should be using. Try
dhclient last, so that it's not attempted when not explicitly
configured or everything else fails.
2024-07-11 11:09:31 +02:00
Lubomir Rintel
001b3e9494 build/meson: deprecate dhclient
Make it off by default. Point out it's deprecated in a config summary.

It's not maintained upstream. There's probably not much justification for
using it any more and we'd like to remove it at some point.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Lubomir Rintel
49f872e6b5 build/autoconf: deprecate dhclient
Make it off by default. Point out it's deprecated in a config summary.

It's not maintained upstream. There's probably not much justification for
using it any more and we'd like to remove it at some point.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Fernando Fernandez Mancera
c8005a4e65 merge: branch 'bg/wifi-ap-channel-width'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1950
2024-07-10 14:55:07 +02:00
Beniamino Galvani
7bb5961779 supplicant: honor the 'wifi.channel-width' property in AP mode 2024-07-10 14:53:32 +02:00
Beniamino Galvani
a591c0ca95 libnm,nmcli: add a 'wifi.channel-width' setting
At the moment, the access point mode uses 20MHz channels. Introduce a
new 'wifi.channel-width' property that allows the use of a larger
bandwidth, thus increasing performances.
2024-07-10 14:53:32 +02:00
Beniamino Galvani
c32c731272 libnm-core: add 1.50 macros 2024-07-10 14:53:32 +02:00
Lubomir Rintel
c8ff1b30fb nmcli/dev: use secret agent for nmcli d [wifi] connect
Instead of asking the Wi-Fi password in advance (or not at all, if we're
creating a new connection for "nmcli d conn"), use the secret agent.

This makes things consistent with other places where we handle the secrets
for an activating connection in nmcli ("nmcli c up", "nmcli d con" with
an existing connection).

This also fixes the situation where the secrets would stop being
required, such as on enrollment via WPS button press on a router.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1960
2024-07-10 14:40:12 +02:00
Lubomir Rintel
51a43fb301 contrib/rpm: pull in formatting fixes from Fedora 2024-07-10 14:21:19 +02:00
Lubomir Rintel
3d0ddfd6be contrib/rpm: turn %ifcfg_migrate into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
151decd333 contrib/rpm: turn %ifcfg_warning into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
cfc6cd7a74 contrib/rpm: turn %split_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
2066e1743e contrib/rpm: turn %with_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
e4660336e7 contrib/rpm: turn %config_plugins_default_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
b87845b584 libnmc/secret-agent-simple: advise if WPS PBC enrollment is active
Print a different message on "nmcli --ask d wifi connect" if WPS
enrollment is in progress.

This is the same as GNOME Shell's secret agent (and perhaps
others) do.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1961
2024-07-10 13:15:04 +02:00
Fernando Fernandez Mancera
4f7c04eaf9 tools: add nm-to-rhcos script to our toolset
Script to create a RHCOS custom image containing a NetworkManager rpm from
a copr repository.

In order to have a custom RHCOS image, we cannot modify the image itself but
we can add a custom layered image that includes all RHCOS functionality and
adds additional functionality to it.

Requirements:
- A quay.io registry where you have push access.
- You must have your pull-secret in the same directory where the script is
being run. You can download your pull-secret from:
https://console.redhat.com/openshift/install/pull-secret

In order to install this on nodes from a cluster that already exists it must
be done using MachineConfig operator. In essence the following YAML file
must be created.

```
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: <role>
  name: os-layer-custom-nm
spec:
  osImageURL: <registry>
```

Please, notice that the role and registry need to be set to your needs.

Then, it can be applied by:

$ oc create -f <yaml file>

Finally, the machines will be ready once the field UPDATED has the True value
in the output of this command.

$ oc get mcp
2024-07-08 13:50:52 +02:00
Stanislas FAYE
71383394d5 release: bump version to 1.49.2 (development) 2024-07-05 13:33:24 +02:00
Stanislas Faye
c05f8d4758 merge: branch 'sf/update-news-for-1.50'
NEWS: update changes in 1.50

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1982
2024-07-05 07:46:00 +00:00
Stanislas FAYE
8e8277bedc NEWS: update changes in 1.50 2024-07-05 09:07:37 +02:00
Beniamino Galvani
5aa5d87ed6 merge: branch 'bg/hostname-fallback-hosts'
Consider entries in /etc/hosts for hostname resolution

https://issues.redhat.com/browse/RHEL-33435
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1974
2024-07-04 13:41:13 +00:00
Beniamino Galvani
543ebef32b docs: document the hostname management workflow 2024-07-04 15:39:03 +02:00
Beniamino Galvani
410afccb32 core: also use /etc/hosts for hostname resolution
Before introducing the hostname lookup via nm-daemon-helper and
systemd-resolved, we used GLib's GResolver which internally relies on
the libc resolver and generally also returns results from /etc/hosts.

With the new mechanism we only ask to systemd-resolved (with
NO_SYNTHESIZE) or perform the lookup via the "dns" NSS module. In both
ways, /etc/hosts is not evaluated.

Since users relied on having the hostname resolved via /etc/hosts,
restore that behavior. Now, after trying the resolution via
systemd-resolved and the "dns" NSS module, we also try via the "files"
NSS module which reads /etc/hosts.

Fixes: 27eae4043b ('device: add a nm_device_resolve_address()')
2024-07-04 15:39:03 +02:00
Beniamino Galvani
229bebfae9 nm-daemon-helper: add "service" argument
Introduce a new argument to specify a comma-separated list of NSS
services to use for the "resolve-address" command. For now only accept
"dns" and "files"; the latter can be used to do a lookup into
/etc/hosts.

Note that previously the command failed in presence of extra
arguments. Therefore, when downgrading NetworkManager without
restarting the service, the previously-installed version of the daemon
(newer) would spawn the helper with the extra argument, and the
newly-installed version of the helper (older) would fail. This issue
only impacts hostname resolution and can be fixed by just restarting
the daemon.

In the upgrade path everything works as before, with the only
difference that the helper will use by default both "dns" and "files"
services.

Don't strictly check for the absence of extra arguments, so that in
the future we can introduce more arguments without necessarily break
the downgrade path.
2024-07-04 15:39:03 +02:00
Beniamino Galvani
8c80077805 wwan: fix code format
Fixes: c0ddcf2998 ('wwan: Ensure we get existing objects on reset')
2024-07-04 15:38:03 +02:00
Cédric Bellegarde
c0ddcf2998 wwan: Ensure we get existing objects on reset
When ModemManager become available, NetworkManager resets
GDBusObjectManagerClient object.

But there is a race condition if object-added is emitted before
modm_ensure_manager(), we need to check existing objects if we want to be
in sync with ModemManager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1957
2024-07-03 15:07:51 +02:00
Íñigo Huguet
73602b9d98 merge: branch 'ndisc-allow-multiple-gateways'
ndisc: support multiple gateways for a single network

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1952
2024-06-28 11:17:51 +00:00
Stefan Agner
f766059ea8 ndisc: support multiple gateways for a single network
Also check for gateway equality when deduplicate routing entries. This
allows to support multiple routes to the same network using different
gateways. This is useful for Thread networks where multiple BRs route
to the same Thread network. If one of these BRs go offline, fallback to
a different router will be much quicker if multiple entries are present.

Note that quick fallback to a different router requires IPv6
reachability probe to be active. Typically Linux disables reachability
probes on Linux machines which act as IPv6 gateway (when forwarding is
enabled).
2024-06-28 11:17:37 +00:00
Íñigo Huguet
7be55d6eff merge: branch 'jv/nmtui-veth'
nmtui: add veth page

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:02:11 +00:00
Jan Vaclav
e74f506b81 nmtui: include veth devices in activation dialog 2024-06-28 11:01:51 +00:00
Jan Vaclav
187ff4c73b nmtui: add veth page
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:01:51 +00:00
Íñigo Huguet
c2e6959af2 merge: branch 'jv/fix-newt-error-handling'
nmtui: handle write() errors correctly in nmt_newt_edit_string

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1971
2024-06-28 10:58:20 +00:00
Jan Vaclav
13317bd536 nmtui: handle write() errors correctly in nmt_newt_edit_string
It might happen that write() returns -1, but the errno is not EINTR.
In that case, the length would be incremented by 1, and the data pointer
to the data being written would be moved back by 1 byte on every error.

Make it so that the function exits with an error if it indicates an error.

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

Fixes: 3bda3fb60c ('nmtui: initial import of nmtui')
2024-06-28 10:58:11 +00:00
Íñigo Huguet
4b66f9fe71 merge: branch 'ih/distros-info-yml'
ci: add file with info about distros that we test

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1977
2024-06-28 10:56:48 +00:00
Íñigo Huguet
e15a9aa1a5 ci: add file with info about distros that we test
Useful to have easily accessible the info of all the distros that we
test, including the version of NM that they ship and their EOL dates so
we can know when to stop testing them.

For now this is only informative, but we can use this info, for example,
to generate the `.gitlab-ci/config.yml` file automatically for each
stable branch.
2024-06-28 10:56:28 +00:00
Beniamino Galvani
c759525e99 merge: branch 'bg/dhcp-remove-addr-on-expiry'
dhcp: remove the address synchronously on lease expiry

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1939
2024-06-28 07:44:23 +00:00