Commit graph

34609 commits

Author SHA1 Message Date
Sven Püschel
7bbd9b9439 merge: branch 'requestoptions'
Add dhcp-request-options setting

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2302
2026-05-08 11:39:12 +02:00
Íñigo Huguet
81209b4688 merge: branch 'ih/fix_uint_uflow'
daemon: fix substraction underflow

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2409
2026-05-08 05:40:40 +00:00
Íñigo Huguet
f1024d047f daemon: fix substraction underflow
Fixes: 1747eb96d6 ('manager: Ensure DHCP interface delete first when daemon stop')
2026-05-07 15:03:36 +02:00
Sven Püschel
fcb6dd3060 Add NEWS entry for the dhcp-request-options setting
Add a NEWS entry to describe the new dhcp-request-option setting. This
only mentions the ipv4 option, as the ipv6 option cannot be used by the
user, as it would require including private headers from systemd to
access the DHCPv6 options.
2026-05-05 18:09:33 +02:00
Sven Püschel
72b5b63930 ip6: disallow setting ipv6.dhcp-request-options
Disallow setting the ipv6.dhcp-request-options by verifying that no
value has been set. This is neccessary, as the option is currently not
supported, but may be supported in the future.

The problem implementing the DHCPv6 support is that NetworkManager
currently uses the systemd DHCPv6 implementation. But in order to access
the option data (already parsed by systemd) we would need to include
private systemd headers, as the necessary functions or structures are
not exposed in the currently included headers. As the long term goal is
to replace the DHCPv6 implementation, the setting is kept for ipv4/ipv6
so it can be implemented quickly when a new DHCPv6 implementation is
added.
2026-05-05 18:01:16 +02:00
Sven Püschel
75c1ddce19 dhcp-client4: implement additional DHCP request options
Implement requesting additional DHCP options in the internal DHCPv4
client and encode the returned values as hex string to be used by
external components like dispatcher scripts.
2026-05-05 14:12:54 +02:00
Sven Püschel
2cad3544a0 Test DHCP request option changed signal
Test that the DHCP request option functions trigger the changed signal
if they modify the list of request options. Note that clearing is
treated differently than an empty list of options, as an empty list
overrides the default options.
2026-05-05 14:12:54 +02:00
Sven Püschel
c06bfae5fd Add dhcp-request-options setting
Add a setting to request additional dhcp options from a DHCP server.
This is intended to be used for external software like dispatcher
scripts, which want to query these additional option values.
2026-05-05 14:12:54 +02:00
Rahul Rajesh
19b065bc4a merge: branch 'rr/controller-dhcp-send-release'
device: send dhcp send release before device removed

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2400
2026-04-30 15:31:39 +00:00
Gris Ge
1747eb96d6 manager: Ensure DHCP interface delete first when daemon stop
Given linux bridge/bond holds DHCP config with
`ipv4.dhcp-send-release: ture` or `ipv6.dhcp-send-release: true`,
when stopping NetworkManager daemon, then NM daemon might
remove/deactivate physical interface first causing DHCP release packet
cannot be delivered.

To fix the issue, we sort the device deletion to let software device
that holds DHCP config to remove first.

Merge Request: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2379

Co-authored-by: Rahul Rajesh <rajeshrah22@gmail.com>
2026-04-29 17:04:04 -04:00
Rahul Rajesh
09784fcce3 device: cleanup DHCP before devices removed
Add _dev_ipdhcpx_cleanup in __set_state_full in DEACTIVATING STATE
before STATE_CHANGED signal is emitted to ensure DHCP RELEASE
packet is sent.

Assisted-by: Cursor with Claude Opus 4.5
2026-04-29 17:03:57 -04:00
Jan Vaclav
9303996b44 merge: branch 'jv/coverity'
coverity: fix bugs found by static analysis

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2394
2026-04-15 08:33:32 +00:00
Jan Vaclav
ca326bd636 libnm/tests: fix dead code in WireGuard roundtrip test
The inner condition at line 4086 duplicated the outer check for
NM_CONNECTION_SERIALIZE_ALL, making the else-if branch for
NM_CONNECTION_SERIALIZE_WITH_NON_SECRET unreachable. This meant
the non-secret serialization path was never actually tested.

Restructure to make both branches reachable.

Found by Coverity (CID: DEADCODE).

Fixes: 395a78618b ('libnm/tests: add tests for creating wireguard connection profiles')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
3d4ad7b4ba libnm: fix wrong variable in route attribute validation error message
The validation checks 'addr' (the extracted address portion before '/')
but the error message prints 'string' (the full input including the
prefix). For input like "192.168.1.999/24", the error would show the
full string instead of just the invalid address part.

Found by Coverity (CID: COPY_PASTE_ERROR).

Fixes: 539db43619 ('libnm: avoid heap allocation for checking valid routes in nm_ip_route_attribute_validate()')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
33871478b7 initrd: fix use-after-free when multiple iBFT entries fail
The error variable is declared outside the loop but freed with
g_error_free() which does not reset the pointer to NULL. On the
next iteration, g_set_error() sees a non-NULL *err (dangling pointer)
and error->message dereferences freed memory.

Use g_clear_error() instead which also resets the pointer.

Found by Coverity (CID: USE_AFTER_FREE).

Fixes: ecc074b2f8 ('initrd: add command line parser')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
00f9a3d862 nmtui/wireguard: fix peer leak when adding new peer
nm_wireguard_peer_new() returns a new peer with refcount 1.
nmt_wireguard_peer_editor_new() takes its own copy via
g_value_dup_boxed(), so the original peer was never unreffed.

Unref the peer after passing it to the editor.

Found by Coverity (CID: RESOURCE_LEAK).

Fixes: b0f5b1d97a ('tui: add WireGuard support to nmtui')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
8685ac1845 dns: fix infinite loop in assertion checking search domains
The loop condition checked the same pointer twice instead of checking
the array element: `ip_data->domains.search && ip_data->domains.search`
should be `ip_data->domains.search && ip_data->domains.search[i]`.

As written, the loop would never terminate when `search` is non-NULL
(only in debug builds with NM_MORE_ASSERTS > 5).

Found by Coverity (CID: CONSTANT_EXPRESSION_RESULT).

Fixes: b8dab47705 ('dns: fix handling default routing domains with systemd-resolved')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
56099c5e14 device: fix potential null dereference when releasing port
find_port_info() can return NULL if the port is not registered.
The code dereferenced `info->port_state` before the null check,
which would crash. Move the null check before the dereference.

Found by Coverity (CID: REVERSE_INULL).

Fixes: a8329587c8 ('device: fix bug when deactivating port connections asynchronously')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
4565c9efe4 policy: fix integer overflow in IPv6 PD subnet calculation
The literal `1` is a 32-bit int. When prefix length is less than 33,
the shift `(64 - plen)` exceeds 31 bits, causing undefined behavior.
Cast to guint64 (same type as `num_subnets`) to perform the shift in
64-bit arithmetic.

Found by Coverity (CID: OVERFLOW_BEFORE_WIDEN).

Fixes: ec12fcf6bf ('policy: delegate IPv6 configuration to ipv6.method=shared connections')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:53:43 +02:00
Íñigo Huguet
6b038ef4dc merge: branch 'issue1476'
bond: change default value of `arp_missed_max`

Closes #1476

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2288
2026-04-14 05:46:02 +00:00
Pradyumn Rahar
921fe6ec68 The valid range of arp_missed_max according to the kernel is 1-255,
while the default value of the same in NM is 0, which causes warnings to
arise, change this default value.

Allow the range in NM to stay 0-255 as 0 is used to indicate arp_missed_max
is unset (for modes that don't support the setting), however do not let it
be set beyond the kernel permissible range for the modes that support it, set
it to the kernel default of 2 instead.

Do not apply or reapply the arp_missed_max setting when it is not
supported.

Signed-off-by: Pradyumn Rahar <pradyumn.rahar@oracle.com>
2026-04-14 10:20:27 +05:30
Íñigo Huguet
95a329a927 merge: branch 'misc-fixes'
Miscellaneous fixes: veth, macvlan, spec

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2248
2026-04-09 13:39:21 +00:00
David Ward
09e2de8b68 spec: fix scriptlet dependencies
Adjust %postun to handle missing udev, in the same way %post does.
This permits installation inside a container without udev.

/usr/sbin/update-alternatives is needed for the initscripts-updown
subpackage only.
2026-04-09 13:33:32 +00:00
David Ward
372fb5792c veth: fix updating peer when link changed
When creating the first device in a veth pair, the peer ifindex is
valid, but the peer device does not exist yet. This should be set
when update_properties() is called for the second device, but fix
the conditional.
2026-04-09 13:33:32 +00:00
David Ward
631127d2e5 macvlan: fix D-Bus property name 2026-04-09 13:33:32 +00:00
Jan Vaclav
fe793cd783 merge: branch 'jv/tui-bond-other'
nmtui/bond: introduce "other options" list

Closes #1805

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2392
2026-04-09 09:54:25 +00:00
Jan Vaclav
0b3db7c6ee nmtui: rename NMTAddressList -> NmtList 2026-04-09 11:33:20 +02:00
Jan Vaclav
6a841072ec nmtui/bond: introduce "other options" list
Bond connections can have options that are not exposed by any widget
in the bond editor. The presence of certain mode-specific options makes
it impossible to change the mode, e.g. from 802.3ad to active-backup
when `lacp_rate` is set.

Introduce an "Other options" list that shows all bond options not
already configurable by a specific widget, and allow the user to edit
them as key=value entries.

Resolves #1805
Resolves: https://redhat.atlassian.net/browse/NMT-1888
2026-04-09 11:33:20 +02:00
Íñigo Huguet
e8f379abb8 merge: branch 'fix/pppd-gateway-empty-ipcp'
pppd-plugin: fix gateway for PPP connections without carrier-provided remote IP

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2383
2026-04-09 08:00:31 +00:00
Ben Hagen
bd0a6356eb pppd-plugin: fix gateway for PPP connections without carrier-provided remote IP
During the dbus-glib to GDBus port in 89228569f (2014), the last-resort
gateway in nm_ip_up() was accidentally changed from peer_opts.hisaddr to
peer_opts.ouraddr. peer_opts.ouraddr is typically 0 when IPCP does not
provide a peer address, causing gateway=0 and broken PPP connectivity
probing/routing behavior.

Restore the original behavior from 369299271 (2008).

Fixes: 89228569f8 ('ppp-manager: port nm-pppd-plugin from dbus-glib to gdbus')
2026-04-09 08:00:12 +00:00
Íñigo Huguet
5e02f13611 merge: branch 'main'
po: Update Serbian (sr) and Serbian Latin (sr@latin) translations

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2385
2026-04-08 13:06:28 +00:00
Марко М. Костић (Marko M. Kostić)
834ae00607 po: Update Serbian Latin translation 2026-04-08 13:05:36 +00:00
Марко М. Костић (Marko M. Kostić)
d9c143ee58 po: Update Serbian translation 2026-04-08 13:05:36 +00:00
Íñigo Huguet
230009b9e8 merge: branch 'ih/sl-po'
po: update Slovenian translations

Closes #1894

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2374
2026-04-08 10:53:34 +00:00
filmsi
253ce99d2c po: update Slovenian translations 2026-04-08 10:53:25 +00:00
Íñigo Huguet
c86ae51240 merge: branch 'fixtypo'
Fix typos

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2371
2026-04-08 10:19:36 +00:00
Hiroyuki Yasuhara
9ca09aa020 cloud-setup/man: fix typo in man nm-cloud-setup 2026-04-08 10:19:23 +00:00
Hiroyuki Yasuhara
a6e133d5f4 libnm/docs: fix typo in man nm-settings-nmcli 2026-04-08 10:19:23 +00:00
Hiroyuki Yasuhara
330cb6a20b docs/libnm: fix typo in libnm.svg 2026-04-08 10:19:23 +00:00
Íñigo Huguet
92bf0178a4 merge: branch 'typo-fixes-2026'
libnmc-setting: fix typos

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2377
2026-04-08 10:17:06 +00:00
Anders Jonsson
e50272de78 libnmc-setting: fix typos 2026-04-08 10:13:31 +00:00
Íñigo Huguet
72950e5d5b merge: branch 'fix/meson'
meson: fix cross-compilation issues

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2380
2026-04-08 10:11:27 +00:00
Andrej Kozemcak
e5d2c7cc6d meson: fix cross-compilation issues
Strip newline from GI_TYPELIB_PATH and LD_LIBRARY_PATH
run_command().stdout() returns the raw shell output including a trailing
newline. When the value is used to build a colon-separated path, the newline
gets embedded at the end of the last path component, making the directory
invalid and causing GObject Introspection to fail with:

  ImportError: Typelib file for namespace 'Gio', version '2.0' not found

Use .strip() to remove leading/trailing whitespace from both env variable
reads.

Fix jansson SONAME detection for cross-compilation
When cross-compiling, jansson's pkg-config 'libdir' variable returns a
path relative to the sysroot (e.g., /usr/lib) without the actual sysroot
prefix.  The host readelf binary cannot find the library at that path.

Fix this by using meson.get_external_property('sys_root', '') to obtain
the sysroot path set by the cross-compilation environment and prepend it
to the library path before calling readelf.

Signed-off-by: Andrej Kozemcak <andrej.kozemcak@siemens.com>
2026-04-08 10:11:13 +00:00
Íñigo Huguet
bb50e8f0f4 merge: branch 'rr/fix-avc-error-2'
core: use GDir to avoid libgvfs loading

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2384
2026-04-08 08:30:37 +00:00
Rahul Rajesh
2e1ee043a7 core: use GDir to avoid libgvfs loading
Replace GFile with GDir to avoid libgvfs and other DBus infra
initialization.

This was done mainly to avoid heavy initialization just for executing
NetworkManager --print-config command.

Resolves: https://redhat.atlassian.net/browse/RHEL-140113
2026-04-08 08:30:18 +00:00
Íñigo Huguet
58f4c81673 merge: branch 'ih/dhcp-client-unknown'
dhcp: improve log message for unknown DHCP plugin

Closes #1917

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2388
2026-04-08 07:50:51 +00:00
Íñigo Huguet
24c50803a7 dhcp: improve log message for unknown DHCP plugin
If a DHCP plugin is unknown, the logs says "DHCP client 'x' not
available". This is the same message that is shown if, for example, it
is a valid DHCP plugin name, but the program is not installed in the
system.

For example, after 'dhclient' was deprecated, now NM is built without
support for it. Then, people with old configs `dhcp=dhclient` get the
message "DHCP client 'dhclient' not available". That seems to mean that
dhclient is not installed.

Show a message "unknown DHCP client" instead.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/work_items/1917
2026-04-08 07:50:41 +00:00
Íñigo Huguet
7f4efc484c merge: branch 'ih/spec'
rpm spec: set polkit_noauth_group=wheel by default

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2391
2026-04-08 07:50:11 +00:00
Íñigo Huguet
1970d8a8cd spec: set polkit_noauth_group=wheel by default
In Fedora there were complains about needing sudo to do changes. We
decided to allow doing changes without additional authentication if
they're done from a local console and an admin account.
2026-04-08 07:49:52 +00:00
Gris Ge
de91bd8070 merge: branch 'jv/clat-macro'
l3cfg: wrap _clat_prefix_is_better() in HAVE_CLAT guard

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2390
2026-04-01 10:06:51 +00:00