summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-15platform: add netlink support for bond port optionsFernando Fernandez Mancera7-33/+250
sysfs is deprecated and kernel will not add new bond port options to sysfs. Netlink is a stable API and therefore is the right method to communicate with kernel in order to set the link options. (cherry picked from commit bb435674b56e876084d4c31138ea95cb3174759f) (cherry picked from commit 1bce7f0dec6c558fff8c6689d79cb7839eb925fe)
2023-05-15bond,bridge,team: use uuid for con.master when generating connectionLubomir Rintel3-12/+15
If we're generating a connection for an externally configured slave, refer the master by the UUID instead of the device name. This doesn't matter most of the time. However, on a checkpoint restore we need to make sure that a connection that is unambiguously the original master is up. Otherwise it could happen that a different connection was activated on the same master device and the slaves being restored don't agree on which master connection to bring up. I can't think of any thing that would rely on this but I've been wrong about more serious things before. Fixes-test: @libnm_snapshot_reattach_unmanaged_ports_to_bridge https://bugzilla.redhat.com/show_bug.cgi?id=2125615 (cherry picked from commit dc254f90e2b306700a0b81f7194e9b0438c62f4c)
2023-05-15platform: rename link_change() to link_change_extra()Beniamino Galvani3-13/+19
There are many functions to replace properties of a link (link_set_address, link_set_mtu, link_set_name, link_change, etc.). Eventually, they will be replaced by a function that does everything and removes all the code duplication. That function will be named link_change(); rename the current link_change() to link_change_extra(). (cherry picked from commit babe2bacd3e23e03d5066b82ac0bb57c60b9db6f) (cherry picked from commit 9ae85f6541505300ac811dff4671fe56a6d11ab7)
2023-05-15libnm: fix ifcfg variable documentation at queue-id propertyFernando Fernandez Mancera1-1/+1
The correct variable for queue-id in ifcfg is BOND_PORT_QUEUE_ID. (cherry picked from commit 762cd06ffa4ff56b096128c26c931843429dc8c5) (cherry picked from commit 87316737f36202902df76e5da6ba130e7bec4dfe)
2023-05-03NEWS: belatedly mention default for ipv6.addr-gen-modeThomas Haller1-0/+2
Fixes: e6a33c04ebe1 ('all: make "ipv6.addr-gen-mode" configurable by global default') (cherry picked from commit 48a3682a75bed6e65836341d1a13be5ed3f77939) (cherry picked from commit 987f98197b04c4786a9501ef0e034377e64fb0d7)
2023-04-19device: emit dhcp-change dispatcher event also after a lease renewalBeniamino Galvani1-6/+6
Fixes: e1648d0665a0 ('core: commit l3cd asynchronously on DHCP bound event') Co-authored-by: Thomas Haller <thaller@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=2179537 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1609 (cherry picked from commit cab80c5129b293a9459d72bd4339f56a62b85eba) (cherry picked from commit b3584ae994d2efedf75c3fcf66eabbcc6bed2564)
2023-04-11device: stop activation when queueing the unmanaged stateBeniamino Galvani1-0/+3
When the unmanaged state is queued, we must ensure that the current activation doesn't overwrite the queue stated with a new one. This can happen for example if a dispatcher script or a firewall call terminate, or if the next activation stage is dispatched. Fixes-test: @preserve_master_and_ip_settings https://bugzilla.redhat.com/show_bug.cgi?id=2178269 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1599 (cherry picked from commit 89a8f51235b7cc9c39c2aea8ff717da4e051f8e6) (cherry picked from commit b2ed01efc981fd3c6a32aac1f29d4e622e2ae305)
2023-04-06dhcp: reset IPv6 DAD flag on lease updateBeniamino Galvani1-0/+1
If the client was waiting for IPv6 DAD to complete and the lease was updated or lost, `wait_ipv6_dad` needs to be cleared; otherwise, at the next platform change the client will try to evaluate the DAD state with a different or no lease. In particular if there is no lease the client will try to decline it because there are no valid addresses, leading to an assertion failure: ../src/core/dhcp/nm-dhcp-client.c:997:_dhcp_client_decline: assertion failed: (l3cd) Backtrace: __GI_raise () __GI_abort () g_assertion_message () g_assertion_message_expr () _dhcp_client_decline (self=0x1af13b0, l3cd=0x0, error_message=0x8e25e1 "DAD failed", error=0x7ffec2c45cb0) at ../src/core/dhcp/nm-dhcp-client.c:997 l3_cfg_notify_cb (l3cfg=0x1bc47f0, notify_data=0x7ffec2c46c60, self=0x1af13b0) at ../src/core/dhcp/nm-dhcp-client.c:1190 g_closure_invoke () g_signal_emit_valist () g_signal_emit () _nm_l3cfg_emit_signal_notify () at ../src/core/nm-l3cfg.c:629 _nm_l3cfg_notify_platform_change_on_idle () at ../src/core/nm-l3cfg.c:1390 _platform_signal_on_idle_cb () at ../src/core/nm-netns.c:411 g_idle_dispatch () Fixes: 393bc628ff69 ('dhcp: wait DAD completion for DHCPv6 addresses') https://bugzilla.redhat.com/show_bug.cgi?id=2179890 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1594 (cherry picked from commit 24461954d0063f1017caa850b8aafe660c564d10) (cherry picked from commit 5019004bad1a230994908f29fe5f7eeb69083b1d)
2023-04-06wwan/ofono: correct MMS proxy property lookupRatchanan Srirattanamet1-3/+3
The property name under `Settings` dict is just `Proxy`, unlike the one outside which is `MessageProxy`. See [1]. [1] https://kernel.googlesource.com/pub/scm/network/ofono/ofono/+/refs/heads/master/doc/connman-api.txt#253 Fixes: a6e81af87f18 ('wwan: add support for using oFono as a modem manager') (cherry picked from commit 264fed47782863ca85841fcf737845decbb9c54c) (cherry picked from commit 7f7fd4244c5480c9c5aca3d52980cb6088e820cd)
2023-04-06release: bump version to 1.40.19 (development)1.40.19-devLubomir Rintel2-2/+2
2023-04-06release: bump version to 1.40.181.40.18Lubomir Rintel2-2/+2
2023-04-06core: fix setting non-blocking FD in nm_utils_spawn_helper()Thomas Haller1-2/+2
Fixes: df1d214b2ea7 ('clients: polkit-agent: implement polkit agent without using libpolkit') (cherry picked from commit 20bd6b68036b9696d39c96cb0c1600c42d8d4255)
2023-04-06core: fix setting FD flags in _rfkill_update_system()Thomas Haller1-9/+1
F_SETFL will reset the flags. That is wrong, as we only want to add O_NONBLOCK flag and leaving the other flags alone. Usually, we would need to call F_GETFL first. Note that on Linux, F_SETFL can only set certain flags, so the O_RDWR|O_CLOEXEC flags were unaffected by this. That means, most likely there are no other flags that our use of F_SETFL would wrongly clear. Still, it's ugly, because it's not obvious whether there might be other flags. Avoid that altogether, by setting the flag already during open(). Fixes: 67e092abcbde ('core: better handling of rfkill for WiMAX and WiFi (bgo #629589) (rh #599002)') (cherry picked from commit 62a85fa84560dc296796c3a63f698f8c15794b99)
2023-04-06core: fix setting non-blocking stderr in nm_utils_spawn_helper()Thomas Haller1-1/+1
Fixes: d65702803cb0 ('core: print stderr from nm-daemon-helper') (cherry picked from commit d1f7e439c6103f3e635beb221718eb09241c6fdb)
2023-04-06core: fix setting non-blocking FD in nm_utils_spawn_helper()Thomas Haller1-2/+2
Fixes: 6ac21ba916b3 ('core: add infrastructure for spawning a helper process') (cherry picked from commit fd123315e548cb4879bf4b3820d8a9d91d06674e)
2023-04-06release: improve hint about documentation in "release.sh"Thomas Haller1-0/+1
A "minor" release can still be the latest release. It depends on which minor release you do. The script isn't smart enough to understand the difference, so make the hint a bit clearer. (cherry picked from commit 3c548dd08150d5f3d2c23f5f9a6d0da429732f04)
2023-04-06release: fix honoring $ORIGIN environment variableThomas Haller1-2/+3
(cherry picked from commit b88700bd4bfb1f338b43add2f9e0b1b86edda1a4)
2023-04-06contrib/release: fix version in import-docs hint messageThomas Haller1-1/+6
(cherry picked from commit a798b4f3f6e0f77dd9019178fff48beefa5c7dc9)
2023-04-06contrib/release.sh: add hint about publishing documentation on websiteThomas Haller1-1/+30
(cherry picked from commit 00affc7b6f268d54f0205e325806ba9ab7e3da22)
2023-04-06NEWS: updateLubomir Rintel1-0/+10
2023-04-03libnm/tests: avoid uninitialized variable warning in ↵Thomas Haller1-2/+2
_invalid_option_write_handler() src/libnm-core-impl/tests/test-keyfile.c: In function '_invalid_option_write_handler': src/libnm-core-impl/tests/test-keyfile.c:917:9: error: 'message' may be used uninitialized [-Werror=maybe-uninitialized] 917 | g_assert(message && strstr(message, "ethtool.bogus")); | ^ src/libnm-core-impl/tests/test-keyfile.c:905:29: note: 'message' was declared here 905 | const char *message; | ^ lto1: all warnings being treated as errors (cherry picked from commit 8d6349156b08be3b0fbebae99529fdb5222caac1) (cherry picked from commit a71e51e712e701cea25ca284cdd21b14f9a22620)
2023-03-29wifi: fix aggressively roaming (background Wi-Fi scanning) based on seen-bssidsThomas Haller6-11/+34
"wifi.seen-bssids" looks like a regular property, but it is not. Unlike almost all other properties, it does not contain user configuration, rather it gets filled by the daemon. The values are thus stored in "/var/lib/NetworkManager/seen-bssids" file, and the daemon maintains the values separately from the profile. Only before exporting the profile on D-Bus, the value gets merged (see NM_SETTINGS_CONNECTION_GET_PRIVATE(self)->>getsettings_cached and nm_connection_to_dbus_full(). Hence, looking at nm_setting_wireless_get_num_seen_bssids() is not working. Fix that. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1253 Fixes: 0f3203338c85 ('wifi: roam aggressively if we on a multi-AP network') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1577 (cherry picked from commit 07c6f933d1b4ba20be43bb5f5d6f977572411750) (cherry picked from commit 3ddc17700ddc2f13b2d635e6fade075a69d6a3cf)
2023-03-29dns: add support to no-aaaa optionFernando Fernandez Mancera4-7/+10
Users can set `no-aaaa` DNS option to suppress AAAA queries made by the stub resolver, including AAAA lookups triggered by NSS-based interfaces such as getaddrinfo. Only DNS lookups are affected. (cherry picked from commit 9d4bbf78f0b3a80eec9115663bd9db2c6460b369) (cherry picked from commit f71cd2eb72d97ee9119e812bba7bbd581c587114)
2023-03-28core: fix l3cd comparisonBeniamino Galvani1-27/+28
NM_CMP_SELF(a, b) returns immediately if the objects are the same. Fixes: cb29244552af ('core: support compare flags in nm_l3_config_data_cmp_full()') Fixes-test: @dracut_NM_iSCSI_ibft_table https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1583 (cherry picked from commit 0a02995175e06e62924705393121a1c5efc3822d) (cherry picked from commit 5d95c20787077a91d684259d67f2e0ff3a1d7a1a)
2023-03-23cloud-setup: actually pass the HTTP method in nm_http_client_poll_req()Lubomir Rintel1-1/+2
https://bugzilla.redhat.com/show_bug.cgi?id=2179718 Fixes: 8b7e12c2d631 ('cloud-setup/ec2: start with requesting a IMDSv2 token') Fixes: cd74d7500278 ('cloud-setup: make nm_http_client_req() accept a method argument') (cherry picked from commit f07da04cd9f16ac9e90d3d57d970ac935ad87b4d) (cherry picked from commit d787c0c59dce57dfacc6602a4f1d5f8d8ed3b193)
2023-03-09cloud-setup/ec2: start with requesting a IMDSv2 tokenLubomir Rintel1-20/+54
The present version of the EC2 metadata API (IMDSv2) requires a header with a token to be present in all requests. The token is essentially a cookie that's not actually a cookie that's obtained with a PUT call that doesn't put anything. Apparently it's too easy to trick someone into calling a GET method. EC2 now supports IMDSv2 everywhere with IMDSv1 being optional, so let's just use IMDSv2 unconditionally. Also, the presence of a token API can be used to detect the AWS EC2 cloud. https://bugzilla.redhat.com/show_bug.cgi?id=2151986 (cherry picked from commit 8b7e12c2d631c47292258c29429cd565715ea186) (cherry picked from commit 429f36cd81ddbe337f04c09a352fd78cd29e394d)
2023-03-09cloud-setup: document detect() and get_config() methodsLubomir Rintel1-0/+28
Clarify that detect() needs to succeed before get_config(). I thought it's sort of common sense, but it's better to be explicit as we're going to rely on that. (cherry picked from commit 088bfd817ab5eb8aa0fb9cffe52fa3f456030ecc) (cherry picked from commit d99864ccba6d7c9bac66dcbbcc49c01be0ddd719)
2023-03-09cloud-setup: make nm_http_client_req() accept a method argumentLubomir Rintel6-0/+31
We'll need to be able to issue PUT calls. (cherry picked from commit cd74d75002783a79d1a4fca24b2fbe99ced933a8) (cherry picked from commit eff4372045290ad380bddf03e5075ab671a7cff6)
2023-03-09cloud-setup: rename get/Get identifiers to req and ReqLubomir Rintel6-114/+114
We're going to extend those to issue methods other than GET. Also, "request" would've been too long, "req" looks nicer. (cherry picked from commit 85ce088616aae3d61c9bc51eb395d1f59ed9a503) (cherry picked from commit 6e8cfbae32e22ba75693146039b53b516a4147e1)
2023-03-09cloud_setup: unexport nm_http_client_get()Lubomir Rintel2-17/+2
It's not used anywhere. (cherry picked from commit ce225b2c06089adc402277f2b80afacb9da8cc5f) (cherry picked from commit 23b9514080c0c578ec5a8e023081837240f41896)
2023-03-09cloud-setup: use nm_strv_dup_packed() in nm_http_client_poll_get()Thomas Haller1-2/+7
No need to do a deep clone. The strv array is not ever modified and we pack it together in one memory allocation. (cherry picked from commit 599fe234ea4864396eb70530513b2646aa97f576) (cherry picked from commit 3787eacac9c1fc9ff9b423f9d9cea9907e209ebb)
2023-03-09platform/tests: avoid accessing in_addr_t via NMIPAddr unionThomas Haller1-2/+6
The compiler may dislike this: CC src/core/platform/tests/libNetworkManagerTest_la-test-common.lo In function '_ip_address_add', inlined from 'nmtstp_ip4_address_add' at ../src/core/platform/tests/test-common.c:1892:5: ../src/core/platform/tests/test-common.c:1807:63: error: array subscript 'NMIPAddr {aka const struct _NMIPAddr}[0]' is partly outside array bounds of 'in_addr_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds] 1807 | peer_address->addr4, | ~~~~~~~~~~~~^~~~~~~ ../src/core/platform/tests/test-common.c: In function 'nmtstp_ip4_address_add': ../src/core/platform/tests/test-common.c:1886:36: note: object 'peer_address' of size 4 1886 | in_addr_t peer_address, | ~~~~~~~~~~~~^~~~~~~~~~~~ ... Fixes: 06aafabf14e6 ('platform/test: add test adding IPv4 addresses that only differ by their peer-address') (cherry picked from commit 40dd8bf93a2757c4ccc2d3c354cfc1fefb05839a) (cherry picked from commit adca87aba9226c70470e3789f8dc6f393e348014)
2023-03-09platform: compare arp_ip_targets_num before arp_ip_target valuesFernando Fernandez Mancera1-1/+1
We must first check whether a->arp_ip_targets_num and b->arp_ip_targets_num are identical. Otherwise, this accesses potentially uninitialized values. Fixes: f900f7bc2c52 ('platform: add netlink support for bond link') (cherry picked from commit 8dd18d91b2c74f43ca2467245f78815bc4df5249) (cherry picked from commit c543c7f9d70a4cd9fe9016f17b4cf076a1a86551)
2023-03-09platform: ensure ext-data is of expected typeThomas Haller1-14/+23
We just lookup the link info by ifindex. There is no guarantee that that ifindex is of the expected type, to have a suitable ext-data. Check for that. Fixes: a7d2cad67eea ('platform/linux: add support for WPAN links') (cherry picked from commit 6dafe780880ecad67780faaa989c8adc63d62d9c) (cherry picked from commit ae1c4f45ad456cb7663ed74fc7c31d58b94fd400)
2023-03-09doc: fix documenting "carrier-wait-timeout" in NetworkManager-wait-online manualThomas Haller1-1/+1
Fixes: df94cb211623 ('man: add NetworkManager-wait-online.service.8 manual') (cherry picked from commit 22c7fd33cc3dbc02702831c571694dc44f99864d) (cherry picked from commit e943387af7021f41deca4fc17458cfdb9d29b671)
2023-03-09libnm: merge branch 'champtar:route-unreachable'Thomas Haller3-3/+3
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1549 (cherry picked from commit 90cc458d31a44c9ab07294cd34691cfb53d5bafc) (cherry picked from commit 0cdd82298912697fe6102e361b0c067479f72016)
2023-03-09platform/trivial: fix route type name (unavailable -> unreachable)Etienne Champetier1-1/+1
Fixes: 766349879ed2 ('platform/trivial: add code comments for NMPGlobalTracker') (cherry picked from commit 0decc027ba889eebc2e927f46022652c67b05eb1) (cherry picked from commit 667ba5227264e795533414ebefe476a0780b9ab7)
2023-03-09doc: fix route type name (unavailable -> unreachable)Etienne Champetier2-2/+2
Fixes: 1cc3d00cb76b ('libnm/doc: list route attributes in `man nm-settings-nmcli`') (cherry picked from commit fb03dbacd8808fca9e4b982c2c841faa5193178a) (cherry picked from commit e308bd79e81c99fa648072bb167a2356032a08f3)
2023-03-02settings: preserve existing connection flags on updateBeniamino Galvani1-2/+6
We are passing to the plugin only 'sett_flags', which is the bitmask of flags to change and works together with 'sett_mask'; however, plugins interpret that value as the new flags value. The result is that if there is no change needed (0/0), the existing flags are lost. Simple reproducer: ip link add dummy1 type dummy ip link set dummy1 up ip addr add dev dummy1 fd01::12/64 sleep 1 # now, a external connection is created by NM echo "BEFORE:" cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external" # just add a new address to the interface to make it lose # the external flag ip addr add dev dummy1 172.25.42.1/24 sleep 1 echo "AFTER:" cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external" Output: BEFORE: nm-generated=true volatile=true external=true AFTER: Fixes: d35d3c468a30 ('settings: rework tracking settings connections and settings plugins') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1548 (cherry picked from commit 86b922695f18566132980bd23516038b6ca4c0f4) (cherry picked from commit 4353f842303d0d905c92e8e497e22f8440261381)
2023-02-23release: bump version to 1.40.17 (development)1.40.17-devBeniamino Galvani2-2/+2
2023-02-23release: bump version to 1.40.161.40.16Beniamino Galvani2-2/+2
2023-02-23NEWS: updateBeniamino Galvani1-0/+11
2023-02-22merge: branch 'bg/hostname-skip-ipv6-tentative'Beniamino Galvani5-50/+120
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1536 (cherry picked from commit 34417ac3e637020f9c1f51906a23491a9e14be31) (cherry picked from commit bc9482f0e52c718d0a0dab1153d8b2230ce32630)
2023-02-22device: skip DNS resolution for tentative IPv6 addressesBeniamino Galvani1-0/+3
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 4138be6a5a508af66b3b79c0eaeb43e3437ee345) (cherry picked from commit 0ebd75381963abc2fb75d39ab44367139db0e34b)
2023-02-22nm-daemon-helper: log to stderr any error from getaddrinfo()Beniamino Galvani1-8/+21
Print errors from getaddrinfo() to stderr so that they will be logged by NM. (cherry picked from commit ac5325e96bb206d7e96d2349126cfdc952345222) (cherry picked from commit 41cd94f46af5a965ed3c84f09748194b5b7f3517)
2023-02-22core: print stderr from nm-daemon-helperBeniamino Galvani1-1/+43
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 d65702803cb02ddd656f13917a8a9af7bc08b90a) (cherry picked from commit f1f1aee711515244322a37150de908e26cfa240f)
2023-02-22device: improve logging for hostname-from-dns eventsBeniamino Galvani3-39/+51
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 7037aa66c6fce01d3e33e1fae32c35fb1f25b363) (cherry picked from commit 7e3dccb781346863ec373f1ea4baf14aa9052878)
2023-02-22core: change buffer allocation size for the daemon helperBeniamino Galvani1-2/+2
Use slightly more efficient sizes. (cherry picked from commit 961824d43b5bd649ff98bb8fbf05d276faff82b6) (cherry picked from commit 8e312f61689ce274f8f6d31a6c3464548632186c)
2023-02-21dhcp: merge branch 'th/dhcp-iaid'Thomas Haller13-90/+252
https://bugzilla.redhat.com/show_bug.cgi?id=2169869 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1534 (cherry picked from commit afbbfebfdbbccff6f01a30daf2626dd512758a4d) (cherry picked from commit 422f086a680aa111ba1556d7e9ca70cf4fc4c34f)
2023-02-21libnm/docs: improve documentation for ipv[46].dhcp-iaid settingThomas Haller3-16/+26
(cherry picked from commit f36fabc0fa5e2c61f55cb595749af17f5e419887) (cherry picked from commit e1d6d72f8e56bbcf605a1885c525ef9b82aed7cc)