Commit graph

31770 commits

Author SHA1 Message Date
Thomas Haller
e943387af7
doc: fix documenting "carrier-wait-timeout" in NetworkManager-wait-online manual
Fixes: df94cb2116 ('man: add NetworkManager-wait-online.service.8 manual')
(cherry picked from commit 22c7fd33cc)
2023-02-28 13:12:14 +01:00
Thomas Haller
0cdd822989
libnm: merge branch 'champtar:route-unreachable'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1549

(cherry picked from commit 90cc458d31)
2023-02-28 13:11:08 +01:00
Etienne Champetier
667ba52272
platform/trivial: fix route type name (unavailable -> unreachable)
Fixes: 766349879e ('platform/trivial: add code comments for NMPGlobalTracker')
(cherry picked from commit 0decc027ba)
2023-02-28 13:11:08 +01:00
Etienne Champetier
e308bd79e8
doc: fix route type name (unavailable -> unreachable)
Fixes: 1cc3d00cb7 ('libnm/doc: list route attributes in `man nm-settings-nmcli`')
(cherry picked from commit fb03dbacd8)
2023-02-28 13:11:07 +01:00
Beniamino Galvani
56ec877f94 device: fix copy/paste error in nm-device-ip-tunnel.c
Fixes: 351c562491 ('devices: support VTI tunnels')
(cherry picked from commit 933e8ea11c)
2023-02-27 13:42:55 +01:00
Beniamino Galvani
8949dd8f3c release: bump version to 1.42.3 (development) 2023-02-23 10:41:13 +01:00
Beniamino Galvani
58928a3188 release: bump version to 1.42.2 2023-02-23 10:41:13 +01:00
Beniamino Galvani
6e28402121 NEWS: update 2023-02-23 09:29:37 +01:00
Fernando Fernandez Mancera
6a438d5157 client/tests: adjust expected output for new order of replace-local-rule
Now replace-local-rule is under routing-rules and therefore expected
output need to be adjusted in tests.

(cherry picked from commit b5e347b313)
2023-02-22 22:37:16 +00:00
Fernando Fernandez Mancera
d09e53ccb7 libnmc-setting: place replace-local-rule under routing-rules
This affects the order in which properties are listed in `nmcli
connection show`. The replace-local-rule property should be after the
routing-rule property.

(cherry picked from commit f46512c54f)
2023-02-22 15:11:05 +01:00
Wen Liang
3ca901483e dbus: deprecate the NMActiveConnection Master property
To embrace the inclusive language, deprecate the NMActiveConnection
Master property and in favor of the NMActiveConnection Controller
property.

(cherry picked from commit af677542b5)
2023-02-21 13:56:16 -05:00
Wen Liang
723b76c8b8 nm-client: expose the method nml_dbus_property_o_notify()
(cherry picked from commit b4e96ec067)
2023-02-21 13:46:24 -05:00
Fernando Fernandez Mancera
4f959945a3 all: add new "ipv[46].replace-local-rule" setting
This setting allows the user to remove the local route rule that is
autogenerated for both IPv4 and IPv6. By default, NetworkManager won't
touch the local route rule.

(cherry picked from commit d2ca44ffc6)
2023-02-21 17:46:30 +01:00
Fernando Fernandez Mancera
779cf25606 platform: introduce function to globally track local route rule
The new function tracks local route rule in the GlobalTracker properly.
It also allow the developer to specify the untrack user tag.

(cherry picked from commit 79611e4fcc)
2023-02-21 17:46:30 +01:00
Wen Liang
934e019270 libnm: add NM_VERSION_1_42_2 2023-02-21 17:46:30 +01:00
Fabrice Fontaine
b5721a8c7b
meson.build: fix build failure with -Dmodem_manager=false
Fix the following build failure with -Dmodem_manager=false raised since
commit 03ba04d478 ('build: meson: add option to set the
mobile-broadband-provider-info database').

  ../output-1/build/network-manager-1.40.10/meson.build:1060:0: ERROR: Unknown variable "mobile_broadband_provider_info_database".

http://autobuild.buildroot.org/results/896879c8e8ce022556ee834216ced2f962ff279c

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Fixes: 03ba04d478 ('build: meson: add option to set the mobile-broadband-provider-info database')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1544
(cherry picked from commit 3a3ac89b53)
2023-02-21 15:00:15 +01:00
Beniamino Galvani
bc9482f0e5 merge: branch 'bg/hostname-skip-ipv6-tentative'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1536

(cherry picked from commit 34417ac3e6)
2023-02-21 13:55:31 +01:00
Beniamino Galvani
0ebd753819 device: skip DNS resolution for tentative IPv6 addresses
A tentative IPv6 address can still fail DAD, so don't use it to
resolve the hostname via DNS. Furthermore, tentative addresses can't
be used to contact the nameserver and so the resolution will fail if
there is no other valid IPv6 address. Wait that the address becomes
non-tentative.

(cherry picked from commit 4138be6a5a)
2023-02-21 13:55:30 +01:00
Beniamino Galvani
41cd94f46a nm-daemon-helper: log to stderr any error from getaddrinfo()
Print errors from getaddrinfo() to stderr so that they will be logged
by NM.

(cherry picked from commit ac5325e96b)
2023-02-21 13:55:30 +01:00
Beniamino Galvani
f1f1aee711 core: print stderr from nm-daemon-helper
Currently the only way to return an error code from the daemon helper
is via the process exit code, but that is not enough to fully describe
an error from getaddrinfo(); in fact, the function returns a EAI_*
error code and when the value is EAI_SYSTEM, the error code is
returned in errno.

At the moment, any messages printed to stderr by the helper goes to NM
stderr; instead, we want to capture it and pass it through the logging
mechanism of NM, so that it can be filtered according to level and
domain.

(cherry picked from commit d65702803c)
2023-02-21 13:55:30 +01:00
Beniamino Galvani
7e3dccb781 device: improve logging for hostname-from-dns events
Improve logging:
 - log only when something changes
 - print the new resolver state, instead of the old one
 - rename state "in-progress" to "started"
 - log when the resolver state is reset due to DNS changes

(cherry picked from commit 7037aa66c6)
2023-02-21 13:55:29 +01:00
Beniamino Galvani
8e312f6168 core: change buffer allocation size for the daemon helper
Use slightly more efficient sizes.

(cherry picked from commit 961824d43b)
2023-02-21 13:55:29 +01:00
Thomas Haller
422f086a68
dhcp: merge branch 'th/dhcp-iaid'
https://bugzilla.redhat.com/show_bug.cgi?id=2169869

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

(cherry picked from commit afbbfebfdb)
2023-02-21 09:30:58 +01:00
Thomas Haller
e1d6d72f8e
libnm/docs: improve documentation for ipv[46].dhcp-iaid setting
(cherry picked from commit f36fabc0fa)
2023-02-21 09:30:55 +01:00
Thomas Haller
657949eacd
dhcp: log used DHCP IAID as hexstr
This is also the format that we will use to expose it in the lease
information. It's the format that dhclient uses.

(cherry picked from commit 2fe4313b92)
2023-02-21 09:30:54 +01:00
Thomas Haller
2e0e38ab17
dhcp: add the DHCPv6 IAID to the lease information
We already get the IAID from the dhclient environment. This is actually
rather useful, because dhclient plugin does not support setting the
value (that is, what we request in "config.v6.iaid" is not actually
used). Already previously, was the IAID for dhclient present in the
lease information. Now also normalize/verify it.

Expose the used IAID also with the internal (systemd) plugin. There we
explicitly set the IAID and know it.

(cherry picked from commit 07f1789725)
2023-02-21 09:30:54 +01:00
Thomas Haller
6e80a19059
dhcp: add "static_key" argument to nm_dhcp_option_add_option() etc.
Our lease is tracked in a plain string dictionary. For dhclient plugin
and similar, the keys are received via the environment, they are thus
unlimited. For the internal plugins they are known at compile time and
static strings. We thus sometimes need to clone the string, and
sometimes not.

Unfortunately, we cannot ask the GHashTable whether it has a free
function for the key, so we need to explicitly tell it. Add a parameter
for that.

(cherry picked from commit 5a05ba398b)
2023-02-21 09:30:53 +01:00
Thomas Haller
0b4446e252
libnm: accept ipv[46].dhcp-iaid as hexstr
dhclient exports the currently used IAID in the environment as
hex string. We expose this environment in our API, so this is also
the format that NetworkManager uses.

Accept setting the ipv[46].dhcp-iaid as hex string, so that the same
format is accepted on the profile.

While at it, also accept a hex number (0x) because it is also
convenient, and this change already introduces the precedent that the
IAID string is not unique/normalized.

(cherry picked from commit e5dc489197)
2023-02-21 09:30:53 +01:00
Thomas Haller
05c6a0d6fa
base: add nm_dhcp_iaid_{from,to}_hexstr() helpers
(cherry picked from commit 4c18adbc74)
2023-02-21 09:30:52 +01:00
Thomas Haller
99825e727b
core: reuse _nm_utils_iaid_verify() for parsing
There should be one function for parsing the string. Use it everywhere.

Also, because we will accept specifying the IAID as hex string so the
same parsing code should be used everywhere.

(cherry picked from commit 69106d0aef)
2023-02-21 09:30:52 +01:00
Beniamino Galvani
b87fa496ce device: update address in nm_device_update_from_platform_link()
When a software device is deactivated, normally we schedule a idle
task to unrealize the device (delete_on_deactivate). However, if a new
activation is enqueued on the same device (and that implies that the
new profile is compatible with the device), then the idle task is not
scheduled and the device will normally transition to the different
states (disconnected, prepare, config, etc.).

For ovs-interfaces, we remove the db entry on disconnect and that
makes the link go away; however, we don't clear the hw_addr* fields of
the device struct.

When the new link appears, we try to set the new cloned MAC but the
stale hw_addr field indicates that it's already set. Avoid this
problem by updating the address as soon as the link appears.

https://bugzilla.redhat.com/show_bug.cgi?id=2168477
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1532
(cherry picked from commit d403ac3d40)
2023-02-20 17:39:45 +01:00
Beniamino Galvani
a2026a8b24 dispatcher: fix constructing the IPv4 nameserver variable
Use the value of the address instead of its pointer.

Fixes: c68e148b02 ('core: extend NML3ConfigData:nameserver to track DNS as string')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1217
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1539
(cherry picked from commit a839395e30)
2023-02-20 09:39:19 +01:00
Ratchanan Srirattanamet
0e4e3e5d74
wwan/ofono: fix a couple of logic errors in update_connection_list()
- Only consider preferred context of "internet" type. There can be
  multiple preferred contexts of multiple types, and we care about
  "internet" type only.
- Don't check for "internet+mms" type. It turns out that "internet+mms"
  isn't a thing in oFono, and is used to represent "internet" context
  with MMSC in the lomiri-system-setting's UI only.

Fixes: 9fc72bf75d ('wwan/ofono: create connections based on available contexts')
Bug-UBports: https://gitlab.com/ubports/development/core/packaging/network-manager/-/issues/3
(cherry picked from commit 08a38ed619)
2023-02-16 16:57:07 +01:00
Julia Dronova
8f796de5e7
po: update Russian (ru) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1213
(cherry picked from commit 3444af517f)
2023-02-13 20:52:50 +01:00
Beniamino Galvani
c273962a73 device: preserve assume state if updating port fails
If we fail to update the port connection, don't forget the assume
state but try again later. This helps when assuming a team connection
and its ports: the ports may fail to generate a connection because
teamd was not started yet; in that case we need to try again.

https://bugzilla.redhat.com/show_bug.cgi?id=2092215
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1523
(cherry picked from commit 27ad228df1)
2023-02-13 15:51:11 +01:00
Heiko Thiery
8f2afc8d40
build: meson: add option to set the mobile-broadband-provider-info database
When building network-manager in cross-compile environment meson is not able
to detect the right location of the mobile-broadband-provider-info
database by using the pkg-config module.

By adding the option 'mobile_broadband_provider_info_database' to set the
correct path to the datafile this can be solved.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1519
(cherry picked from commit 03ba04d478)
2023-02-13 11:03:14 +01:00
Thomas Haller
c1fd9fee12
std-aux: suppress verbose assert message with _nm_assert_fail()
We also do that with g_return*() macros. These strings increase the
binary size for little use. Drop them, unless we build with
more asserts enabled.

This affects nm_assert() messages.

(cherry picked from commit d3548279c1)
2023-02-13 09:59:47 +01:00
Thomas Haller
f5c48ee238
Revert "std-aux: drop assertion and function name from assert() in release mode"
glibc defines __assert_fail as:

  extern void __assert_fail (const char *__assertion, const char *__file,
                             unsigned int __line, const char *__function)
       __THROW __attribute__ ((__noreturn__));

but musl as:

  _Noreturn void __assert_fail (const char *, const char *, int, const char *);

(note the difference in the type for the line argument).

This cannot be made to work, unless we would detect the used type at configure
time, which seems too much effort.

Drop this again.

This reverts commit 1ce29e120b.

Fixes: 1ce29e120b ('std-aux: drop assertion and function name from assert() in release mode')
(cherry picked from commit a29eb970c8)
2023-02-13 09:59:45 +01:00
Thomas Haller
c5917b0a50
libnm/tests: adjust test for glib change in 2.75.0 for assertion warning
See-also: 0ffe86a1f7
(cherry picked from commit 861fc6854c)
2023-02-11 18:33:18 +01:00
Thomas Haller
51b67d4327
libnm/docs: fix gtk-doc generation for settings
Marking "nm-core-types.h" as to be ignored by gtk-doc, causes many files
to have the wrong names:

    /docs/libnm/html/{NMConnection.html => libnm-NMConnection.html}
    /docs/libnm/html/{NMSetting.html => libnm-NMSetting.html}
    /docs/libnm/html/{NMSetting6Lowpan.html => libnm-NMSetting6Lowpan.html}
    /docs/libnm/html/{NMSetting8021x.html => libnm-NMSetting8021x.html}
    /docs/libnm/html/{NMSettingAdsl.html => libnm-NMSettingAdsl.html}
    /docs/libnm/html/{NMSettingBluetooth.html => libnm-NMSettingBluetooth.html}
    /docs/libnm/html/{NMSettingBond.html => libnm-NMSettingBond.html}
    /docs/libnm/html/{NMSettingBondPort.html => libnm-NMSettingBondPort.html}
    /docs/libnm/html/{NMSettingBridge.html => libnm-NMSettingBridge.html}
    /docs/libnm/html/{NMSettingBridgePort.html => libnm-NMSettingBridgePort.html}
    /docs/libnm/html/{NMSettingCdma.html => libnm-NMSettingCdma.html}
    /docs/libnm/html/{NMSettingConnection.html => libnm-NMSettingConnection.html}
    /docs/libnm/html/{NMSettingDcb.html => libnm-NMSettingDcb.html}
    /docs/libnm/html/{NMSettingDummy.html => libnm-NMSettingDummy.html}
    /docs/libnm/html/{NMSettingEthtool.html => libnm-NMSettingEthtool.html}
    /docs/libnm/html/{NMSettingGeneric.html => libnm-NMSettingGeneric.html}
    /docs/libnm/html/{NMSettingGsm.html => libnm-NMSettingGsm.html}
    /docs/libnm/html/{NMSettingHostname.html => libnm-NMSettingHostname.html}
    /docs/libnm/html/{NMSettingIP4Config.html => libnm-NMSettingIP4Config.html}
    /docs/libnm/html/{NMSettingIP6Config.html => libnm-NMSettingIP6Config.html}
    /docs/libnm/html/{NMSettingIPConfig.html => libnm-NMSettingIPConfig.html}
    /docs/libnm/html/{NMSettingIPTunnel.html => libnm-NMSettingIPTunnel.html}
    /docs/libnm/html/{NMSettingInfiniband.html => libnm-NMSettingInfiniband.html}
    /docs/libnm/html/{NMSettingMacsec.html => libnm-NMSettingMacsec.html}
    /docs/libnm/html/{NMSettingMacvlan.html => libnm-NMSettingMacvlan.html}
    /docs/libnm/html/{NMSettingMatch.html => libnm-NMSettingMatch.html}
    /docs/libnm/html/{NMSettingOlpcMesh.html => libnm-NMSettingOlpcMesh.html}
    /docs/libnm/html/{NMSettingOvsBridge.html => libnm-NMSettingOvsBridge.html}
    /docs/libnm/html/{NMSettingOvsDpdk.html => libnm-NMSettingOvsDpdk.html}
    /docs/libnm/html/{NMSettingOvsExternalIDs.html => libnm-NMSettingOvsExternalIDs.html}
    /docs/libnm/html/{NMSettingOvsInterface.html => libnm-NMSettingOvsInterface.html}
    /docs/libnm/html/{NMSettingOvsPatch.html => libnm-NMSettingOvsPatch.html}
    /docs/libnm/html/{NMSettingOvsPort.html => libnm-NMSettingOvsPort.html}
    /docs/libnm/html/{NMSettingPpp.html => libnm-NMSettingPpp.html}
    /docs/libnm/html/{NMSettingPppoe.html => libnm-NMSettingPppoe.html}
    /docs/libnm/html/{NMSettingProxy.html => libnm-NMSettingProxy.html}
    /docs/libnm/html/{NMSettingSerial.html => libnm-NMSettingSerial.html}
    /docs/libnm/html/{NMSettingSriov.html => libnm-NMSettingSriov.html}
    /docs/libnm/html/{NMSettingTCConfig.html => libnm-NMSettingTCConfig.html}
    /docs/libnm/html/{NMSettingTeam.html => libnm-NMSettingTeam.html}
    /docs/libnm/html/{NMSettingTeamPort.html => libnm-NMSettingTeamPort.html}
    /docs/libnm/html/{NMSettingTun.html => libnm-NMSettingTun.html}
    /docs/libnm/html/{NMSettingUser.html => libnm-NMSettingUser.html}
    /docs/libnm/html/{NMSettingVeth.html => libnm-NMSettingVeth.html}
    /docs/libnm/html/{NMSettingVlan.html => libnm-NMSettingVlan.html}
    /docs/libnm/html/{NMSettingVpn.html => libnm-NMSettingVpn.html}
    /docs/libnm/html/{NMSettingVrf.html => libnm-NMSettingVrf.html}
    /docs/libnm/html/{NMSettingVxlan.html => libnm-NMSettingVxlan.html}
    /docs/libnm/html/{NMSettingWifiP2P.html => libnm-NMSettingWifiP2P.html}
    /docs/libnm/html/{NMSettingWimax.html => libnm-NMSettingWimax.html}
    /docs/libnm/html/{NMSettingWireGuard.html => libnm-NMSettingWireGuard.html}
    /docs/libnm/html/{NMSettingWired.html => libnm-NMSettingWired.html}
    /docs/libnm/html/{NMSettingWireless.html => libnm-NMSettingWireless.html}
    /docs/libnm/html/{NMSettingWirelessSecurity.html => libnm-NMSettingWirelessSecurity.html}
    /docs/libnm/html/{NMSettingWpan.html => libnm-NMSettingWpan.html}
    /docs/libnm/html/{NMSimpleConnection.html => libnm-NMSimpleConnection.html}

Revert that part of the change. Even if this regresses other problems.

Fixes: 1330292d05 ('docs/libnm: fix gtkdoc-scan ignore lists')
(cherry picked from commit f0e3ca09c9)
2023-02-10 17:05:04 +01:00
Thomas Haller
90f21c0570
contrib/rpm: fix "--enable-ppp" flag to build without ppp
[thaller@redhat.com: I introduced this bug when taking the original patch].

Fixes: 820f6f3a4a ('contrib/rpm: sync obsoletes_{initscripts_updown,ifcfg_rh} version')
(cherry picked from commit 06dc84a563)
2023-02-10 10:10:55 +01:00
Thomas Haller
d4de1a0894
contrib/rpm: sync obsoletes_{initscripts_updown,ifcfg_rh} version
Initially, when we obsoleted {initscripts_updown,ifcfg_rh}, the package
versions that we build from this upstream spec file differed from what
we put into Fedora/RHEL.

By now, this is long gone, and for upstream package builds we don't care
to accurately track the version, when using upstream/copr builds. Just
sync the version to what they are in Fedora/RHEL.

(cherry picked from commit 820f6f3a4a)
2023-02-10 10:05:19 +01:00
Thomas Haller
68c5a39299
contrib/rpm: merge branch 'th/contrib-updates' 2023-02-10 09:59:09 +01:00
Stewart Smith
7ff297db24
contrib/rpm: fix building without ppp
We need to explicitly say we don't want PPP as the default is
that we do want to build with PPP.

https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13
(cherry picked from commit 2598ec3a1f)
2023-02-10 09:57:41 +01:00
Yaakov Selkowitz
2f69bf7aa4
contrib/rpm: fix flatpak build
https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13
(cherry picked from commit 42cd422f18)
2023-02-10 09:57:40 +01:00
Thomas Haller
e57b64c882
contrib/release.sh: add hint about publishing documentation on website
(cherry picked from commit 00affc7b6f)
2023-02-10 09:48:33 +01:00
Thomas Haller
b7bdd08af6
contrib/copr: better detect git-ref in "nm-copr-build.sh"
(cherry picked from commit fce8e572d0)
2023-02-10 09:48:29 +01:00
Thomas Haller
4a2ab85034
contrib/rpm: fix condition in "NetworkManager.spec" (3)
Fixes: 096b9955d6 ('contrib/fedora: make "lto" in the spec file configurable')
Fixes: 7a62845424 ('contrib/rpm: fix condition in "NetworkManager.spec"')
(cherry picked from commit 36ad5cbb3b)
2023-02-10 09:48:21 +01:00
Thomas Haller
8b04b47755
contrib/rpm: fix condition in "NetworkManager.spec" (2)
Fixes: 096b9955d6 ('contrib/fedora: make "lto" in the spec file configurable')
Fixes: 7a62845424 ('contrib/rpm: fix condition in "NetworkManager.spec"')
(cherry picked from commit 13dfdaf3a0)
2023-02-10 09:48:20 +01:00
Thomas Haller
304489da37
contrib/rpm: fix condition in "NetworkManager.spec"
Fixes: 096b9955d6 ('contrib/fedora: make "lto" in the spec file configurable')
(cherry picked from commit 7a62845424)
2023-02-10 09:48:19 +01:00