Commit graph

34626 commits

Author SHA1 Message Date
Beniamino Galvani
60a1bd4e43 ndisc: fix clean_addresses() overwriting previously accumulated changed flags
clean_addresses() uses "=" instead of "|=" when setting the changed
flags, which overwrites any flags set by previous cleanup functions
(e.g. clean_gateways()). This can cause gateway change notifications
to be lost when gateways and addresses expire at the same time.

Fixes: 4c2035347e ('ndisc: track expiry of Router Advertisements in milliseconds')
2026-06-01 10:29:58 +02:00
Beniamino Galvani
97282d1e50 ndisc: fix wrong array in _array_set_size_max calls during cleanup
The clean_routes(), clean_dns_servers() and clean_dns_domains()
functions all pass rdata->gateways to _array_set_size_max() instead of
their respective arrays.

Fixes: c2c8c67d8c ('ndisc: rate limit number of accepted RA data to track')
2026-06-01 10:29:58 +02:00
Beniamino Galvani
e95d775569 ndisc: fix ordering of routes
When no existing route has lower priority than the new one, insert
at the end of the array instead of at the beginning. This is the
same fix that was applied to gateways.

Fixes: b324b970bc ('rdisc: fix double-addition of gateways & routes if priority increases')
2026-06-01 10:29:57 +02:00
Beniamino Galvani
5b53f8c218 l3cfg: fix CLAT auto loop always quitting at first route
The 'break' statement was outside the 'if' block, causing the
loop to always exit after the first iteration regardless of
whether the route matched the condition.

Fixes: 75c423f4c8 ('core: honor the ipv4.clat property')
2026-06-01 10:29:57 +02:00
Beniamino Galvani
bc67b0211a l3-config-data: fix direct route selection preferring metric over prefix length
In nm_l3_config_data_get_direct_route_for_host(), after the first check filters
out routes with a shorter prefix than the current best, the remaining candidates
have plen >= best_route->plen. The metric comparison must only apply when the
prefix lengths are equal; otherwise a more specific route (longer prefix) is
incorrectly skipped if it has a higher metric than the current best.

Fixes: 695ce608ba ('l3cfg: add nm_l3_config_data_add_dependent_routes()')
2026-06-01 10:29:56 +02:00
Beniamino Galvani
63173a4e33 l3-config-data: fix comparing obj_b with itself in IPv4 address ID comparison
In _dedup_multi_index_cmp(), the !cmp_full path for NMP_OBJECT_TYPE_IP4_ADDRESS
compares obj_b->ip4_address.address with obj_b->ip4_address.address (and same
for peer_address), which always evaluates to zero. This means two different IPv4
addresses with the same plen are incorrectly considered equal.

Use obj_a on the left side of the comparison as intended.

Fixes: cb29244552 ('core: support compare flags in nm_l3_config_data_cmp_full()')
2026-06-01 10:29:56 +02:00
Beniamino Galvani
348af3aa30 dhcp/nettools: don't clear effective client-id on restart
When ip4_start() is called after a restart (priv->client already exists),
nettools_create() is skipped so effective_client_id stays NULL. The
unconditional nm_dhcp_client_set_effective_client_id() call then clears
the client-id that was properly set during the initial start.

Only update the effective client-id when it was actually obtained from
nettools_create().

Fixes: 1db882ca63 ('dhcp: allow the plugin to be restarted')
2026-06-01 10:29:55 +02:00
Beniamino Galvani
b0bdaa29c9 dhcp: fix parsing of client id
Replace "s[1 + 2]" with "s[i + 2]".

Fixes: 8ffa22d10d ('dhcp: dhclient: set type 0 for printable client IDs')
2026-06-01 10:29:26 +02:00
Beniamino Galvani
d6e996fb14 device: fix typo in EPOCH_DATETIME_THREE_YEARS constant
The macro intended to represent approximately three years in seconds
but used 356 days/year instead of 365, making the period 27 days
shorter than intended.

Fixes: 7a0b6b17bb ('libnm-core: add ipv6.dhcp-duid property')
2026-06-01 09:55:06 +02:00
Beniamino Galvani
e7a211caa1 device: fix ref leak in controller_release_port when detach completes synchronously
When detach_port() returns a value other than NM_TERNARY_DEFAULT,
the g_object_ref(port) passed as user_data for the async callback
is never released.

Fixes: 07dc237e5c ('device: wait port detach before leaving the DEACTIVATING state')
2026-06-01 09:55:06 +02:00
Rahul Rajesh
cb71852c20 merge: branch 'bg/enable-clat-on-fedora'
rpm: enable CLAT by default on Fedora 45

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2419
2026-05-28 15:58:21 +00:00
Beniamino Galvani
77c1cf9624 nmtui: fix wrong use of assertions in bond page
When building in release mode the compiler complains with:

  ../src/nmtui/nmt-page-bond.c: In function ‘other_options_widget_changed’:
  ../src/nmtui/nmt-page-bond.c:373:13: error: ‘name’ may be used uninitialized [-Werror=maybe-uninitialized]
    373 |         if (_is_other_option(name)) {
        |             ^~~~~~~~~~~~~~~~~~~~~~
  ../src/nmtui/nmt-page-bond.c:357:25: note: ‘name’ was declared here
    357 |     const char         *name;
        |                         ^~~~

That happens because "name" is initialized inside an assertion, which
is removed in release builds. Assertions must not have side effects.

Move the initialization out of the assertion.

Fixes: 6a841072ec ('nmtui/bond: introduce "other options" list')
2026-05-28 15:19:09 +00:00
Beniamino Galvani
7930ad37c5 rpm: enable CLAT by default on Fedora 45
https://fedoraproject.org/wiki/Changes/IPv6-Mostly_Support_In_NetworkManager
2026-05-28 15:19:09 +00:00
Rahul Rajesh
a6e971fb24 release: bump version to 1.57.5 (development) 2026-05-27 10:53:01 -04:00
Jan Vaclav
e86a08fc91 contrib/alpine/REQUIRED_PACKAGES: drop libsoup-dev
libsoup has not been used in NM since 1.8(!!) and is now breaking
the alpine edge pipeline. Drop it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2412
2026-05-20 13:01:02 +02:00
Íñigo Huguet
066a1405d3 merge: branch 'ts/issue-1948'
IPv6 link with RA and PD should be healthy

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2404
2026-05-18 05:50:11 +00:00
Tim Spriggs
6584624355 core: dhcp6: support PD and LL route
Fixes Issue 1948: IPv6 link with RA and PD should be healthy

Use-case:

Some ISPs provide IPv6 via Prefix Delegation (PD) only. The default route is
link-local and the prefix can be used via an "ipv6.method: shared" interface.
This patch considers PD as a valid address for dhcp6 lease/link purposes.
2026-05-17 18:06:39 +00:00
Íñigo Huguet
0095b9c9df merge: branch 'l10n-sv-update'
Update Swedish translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2398
2026-05-14 11:22:08 +00:00
Daniel Nylander
901f290cbb Update Swedish translation 2026-05-14 11:21:56 +00:00
Íñigo Huguet
98dfa8c83c merge: branch 'ih/parunner-domains'
pacrunner: don't pass DNS search domains to PAC runner

Closes #1940

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2410
2026-05-14 10:52:29 +00:00
Íñigo Huguet
375e10eac5 pacrunner: don't pass DNS search domains to PAC runner
Per pacrunner's documentation:

    array{string} Domains [optional]
	Domain names and IP range for which this proxy
	configuration shall be valid. IP range should
	be in CIDR format. eg:"192.168.1.0/12" for IPv4
	and similarly for IPv6.

The dns-search property is not supposed to affect to the Proxy
settings. Is only meant to contain DNS search domains.

Fixes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/work_items/1940
2026-05-14 10:52:20 +00:00
Íñigo Huguet
e43826cd98 merge: branch 'mention-how-to-disable-ppp-support-in-meson'
Mention how to disable PPP/PPPoE support in meson

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2407
2026-05-13 06:53:14 +00:00
Paul Menzel
414c2c2671 meson: Suggest -Dppp=false when pppd.h is not found
If the header `pppd/pppd.h` is not found, it’s *not* mentioned, that
PPP/PPPoE support can be disabled.

    $ meson setup -Dselinux=false -Dlibaudit=no /dev/shm/nm-build
    […]
    Run-time dependency gnutls found: YES 3.8.9
    Run-time dependency pppd found: NO (tried pkgconfig and cmake)
    Has header "pppd/pppd.h" : NO

    meson.build:627:4: ERROR: Assert failed: couldn't find pppd.h. pppd development headers are required

Add `Use -Dppp=false to build without it.` to help the user.
2026-05-13 06:53:01 +00: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
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