summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dhcp: reset IPv6 DAD flag on lease updatebg/dhcp6-dad-assertionBeniamino Galvani2023-04-061-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
* release: bump version to 1.43.5 (development)1.43.5-devLubomir Rintel2023-04-052-2/+2
|
* ovs: merge branch 'th/ovsdb'Thomas Haller2023-04-0512-184/+300
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1593
| * ovsdb: debug log all messages of socket bufferThomas Haller2023-04-041-2/+11
| |
| * ovsdb: downgrade error logging to warningsThomas Haller2023-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | <error> is mostly about "really should not happen" scenarios. It's closer to an assertion failure, and something that NetworkManager should not happen. Of course, things can go wrong, but <warn> is a sufficient. When ovsdb gives unexpected communication, it's just a warning. At least, that's also what all the similar cases in "nm-ovsdb.c" already do
| * ovsdb: limit maxiumum data size for receive buffer from ovsdbThomas Haller2023-04-041-0/+6
| |
| * ovsdb: add watchdog for unparsable JSON data in socketThomas Haller2023-04-041-1/+30
| |
| * ovsdb: use the FD directly instead of GSocketConnection/GOutputStreamThomas Haller2023-04-041-114/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GSocketConnection/GOutputStream/GInputStream seems rather unnecessary. Maybe they make sense when you want to write portable code (for Windows). Otherwise, watching a file descriptor and reading/writing it directly is simpler (and also more efficient). For example, we passed no GCancellable to g_input_stream_read_async(). What does that mean w.r.t. destroying the NMOvsdb instance? I suspect it's wrong, but it's hard to say, because there are so many layers of code. Note that we anyway keep state in NMOvsdb, namely the data we want to send (output_buf) and the data we partially received (input_buf). All we need, are poll notifications when the file descriptor is ready. To those, we hook up the read/write callbacks. Also before was the code async, and there were callbacks when when read/write was done. That does not simplify the code in any way. - we no longer use separate NMOvsdbPrivate.buf and NMOvsdbPrivate.input buffers. There is just a NMOvsdbPrivate.input_buf that can we can fill directly.
| * ovsdb: use nm_auto_free cleanup attribute in "nm-ovsdb.c"Thomas Haller2023-04-041-6/+4
| |
| * ovsdb: don't track buffer offset in NMOvsdb data and refactor parsing JSON ↵Thomas Haller2023-04-041-25/+46
| | | | | | | | | | | | | | | | | | | | | | | | messages The "priv->bufp" offset is only used while parsing a message at a time. It's unnecessary to track it in NMOvsdbPrivate and keep it between parsing messages. Tracking the state in NMOvsdbPrivate makes it more complicated to understand, because one needs to reason at which times the state is used (when it really is not used). Also, move the parsing to a separate function.
| * core: drop unnecessary initialization in nm_utils_spawn_helper()Thomas Haller2023-04-041-4/+1
| | | | | | | | | | We did not initialize "child_stderr". If that were necessary, we would need to add it too. However, it is clearly not necessary to initialize those fields.
| * core: use nm_io_fcntl_setfl_update_nonblock() helperThomas Haller2023-04-042-14/+5
| |
| * glib-aux: add nm_io_fcntl_setfl_update_nonblock() helperThomas Haller2023-04-042-0/+90
| |
| * all: use G_SPAWN_CLOEXEC_PIPES with g_spawn_async_with_pipes()Thomas Haller2023-04-045-5/+6
| | | | | | | | | | G_SPAWN_CLOEXEC_PIPES is supported since glib 2.40, which we already depend on.
| * platform: drop unused nl_socket_set_nonblocking() functionThomas Haller2023-04-043-14/+0
| | | | | | | | | | | | | | It's not used. It's better to use SOCK_NONBLOCK flag for socket(), as we do. Also, the implementation that blindly calls F_SETFL without merging the existing flags from F_GETFL is just wrong. Drop it altogether.
| * core: fix setting non-blocking FD in nm_utils_spawn_helper()Thomas Haller2023-04-041-2/+2
| | | | | | | | Fixes: df1d214b2ea7 ('clients: polkit-agent: implement polkit agent without using libpolkit')
| * core: fix setting FD flags in _rfkill_update_system()Thomas Haller2023-04-041-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)')
| * core: fix setting non-blocking stderr in nm_utils_spawn_helper()Thomas Haller2023-04-041-1/+1
| | | | | | | | Fixes: d65702803cb0 ('core: print stderr from nm-daemon-helper')
| * core: fix setting non-blocking FD in nm_utils_spawn_helper()Thomas Haller2023-04-041-2/+2
|/ | | | Fixes: 6ac21ba916b3 ('core: add infrastructure for spawning a helper process')
* merge: branch 'bg/rh2054933'Beniamino Galvani2023-04-048-43/+124
|\ | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=2054933 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1569
| * ovs: implement asynchronous detach_port()bg/rh2054933Beniamino Galvani2023-04-041-25/+24
| | | | | | | | | | Make detach_port() return only after ovsdb reports that the operation finished.
| * device: wait port detach before leaving the DEACTIVATING stateBeniamino Galvani2023-04-041-3/+28
| | | | | | | | | | | | The device shouldn't change state from DEACTIVATING to DISCONNECTED until its detached from its controller; otherwise, the port detach that is in progress can conflict with the following activation.
| * device: make detach_port() method asynchronousBeniamino Galvani2023-04-048-19/+76
|/ | | | | | | | | This changes the signature of detach_port() to be asynchronous, similarly to attach_port(). The implementation can return TRUE/FALSE on immediate completion. Current implementations return immediately and so there is no change in behavior for now.
* device: fix assertion condition in _dev_ipdhcpx_start()Thomas Haller2023-04-041-1/+1
| | | | | | | | | | | src/core/devices/nm-device.c: In function '_dev_ipdhcpx_start': src/core/devices/nm-device.c:10672:13: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] nm_assert(pd_hint_length > 0 || pd_hint_length <= 128); ^ src/core/devices/nm-device.c:10672:13: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] src/core/devices/nm-device.c:10672:13: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op] Fixes: e2b9019ac0c2 ('dhcp: support prefix delegation hint')
* merge: branch 'bg/dhcp6-pd-hint'Beniamino Galvani2023-04-0319-541/+872
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1581
| * dhcp: export the prefix delegationBeniamino Galvani2023-04-033-1/+24
| | | | | | | | | | Export the IA_PD option so that it is available via D-Bus and in the lease file in /run.
| * dhcp: support prefix delegation hintBeniamino Galvani2023-04-034-0/+41
| | | | | | | | | | | | | | Support the prefix delegation hint in the DHCP client. dhclient only supports a prefix length, emit a warning if the user set a non-zero prefix.
| * libnm,nmcli: add ipv6.dhcp-pd-hint propertyBeniamino Galvani2023-04-0313-540/+807
|/ | | | Add a new property to specify a hint for DHCPv6 prefix delegation.
* core: merge branch 'th/dameon-helper-cleanup'Thomas Haller2023-04-032-68/+77
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1588
| * core: error out in nm_utils_kill_child_{sync,async}() if first waitpid() ↵Thomas Haller2023-04-032-25/+17
| | | | | | | | | | | | | | | | | | | | gives ECHILD It is wrong trying to send the signal still. Just error out. Note that ECHILD indicates that the process is either not a child or was already reaped. In both cases, that is a bug of the caller who must keep accurate track of the child's process ID.
| * core: pre-allocate exact buffer size for output in nm_utils_spawn_helper()Thomas Haller2023-04-031-1/+4
| | | | | | | | | | | | It's easy enough to know how many bytes are needed. Just allocate the right size (+1, because NMStrBuf really likes to reserve that extra byte for the trailing NUL, even if it's not needed in this case).
| * core/trivial: add code comment about using GChildWatchSourceThomas Haller2023-04-031-0/+12
| |
| * core: use nm_g_child_watch_source_new() in nm_utils_spawn_helper()Thomas Haller2023-04-031-5/+5
| |
| * core: assert that nm_utils_spawn_helper() is used with default contextThomas Haller2023-04-031-0/+6
| |
| * core: store main context in variable in nm_utils_spawn_helper()Thomas Haller2023-04-031-5/+8
| | | | | | | | | | | | There is no change in behavior, because the GTask's context is of course g_main_context_get_thread_default(). Still, not point in making that unclear.
| * core: qualify logging lines related to helper with "nm-daemon-helper"Thomas Haller2023-04-031-8/+2
| | | | | | | | | | Seems to be the better name, because that is also the name of the executable.
| * core: rename nmlog defines in "nm-core-utils.c"Thomas Haller2023-04-031-20/+26
| | | | | | | | Those are related to _NMLOG2() macro. Rename.
| * core: use nm_clear_fd() helper in nm_utils_spawn_helper()Thomas Haller2023-04-031-12/+5
|/
* po: update Ukrainian (uk) translationYuri Chornoivan2023-04-031-603/+585
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1592
* libnm/tests: avoid uninitialized variable warning in ↵Thomas Haller2023-03-311-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
* clients/tests: merge branch 'th/test-client-fixes'Thomas Haller2023-03-312-10/+8
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1591
| * client/tests: don't do dup2() dance to pass file descriptor to ↵Thomas Haller2023-03-302-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | "tools/test-cloud-meta-mock.py" "preexec_fn" is not great, because it is not generally safe in multi threaded code (and we don't know whether the test didn't start other threads already, like a GDBus worker thread). Well, it probably is safe, if you only call async signal safe code, but it's not clear what os.dup2() does under the hood. Just avoid that. We can pass on the FD directly.
| * client/tests: close process stdin in test-python.py to avoid warning about leakThomas Haller2023-03-301-0/+1
| | | | | | | | | | | | | | | | | | test_ec2 (__main__.TestNmCloudSetup.test_ec2) ... /usr/lib64/python3.11/unittest/case.py:579: ResourceWarning: unclosed file <_io.BufferedWriter name=5> if method() is not None: ResourceWarning: Enable tracemalloc to get the object allocation traceback ok Fixes: d89d42bf2317 ('tests/client: test nm-cloud-setup')
| * client/tests: drop unnecessary socket.set_inheritable() call from ↵Thomas Haller2023-03-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "test-client.py" This seems unnecessary, because we spawn the child process via subprocess.Popen and set "pass_fds". That already ensures to pass on the FD. Worse, socket.set_inheritable() is only added in Python 3.4, that means the test is gonna break for Python 3.2 and 3.3. Just avoid that by not using the unnecessary function. For the same reason, drop "inheritable=True" from os.dup2(). "inheritable=True" is already the default, but only exists since Python 3.4. Fixes: d89d42bf2317 ('tests/client: test nm-cloud-setup')
| * client/tests: skip cloud-setup test for older pythonThomas Haller2023-03-301-0/+4
|/ | | | | | | | | | | The test uses subprocess.Popen()'s "pass_fd" argument. That is only available since Python 3.2. Possibly it could be solved differently, but that is not implemented. Instead, skip the test. Also, socket.socket.set_inheritable() is Python 3.4. But presumably we don't need it. Fixes: d89d42bf2317 ('tests/client: test nm-cloud-setup')
* wwan/ofono: merge branch ↵Thomas Haller2023-03-301-4/+13
|\ | | | | | | | | | | 'peat-psuwit:for-upstream/combined-context-mms-proxy-route' https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1584
| * wwan/ofono: account for port in the Proxy propertyRatchanan Srirattanamet2023-03-301-2/+11
| |
| * wwan/ofono: correct MMS proxy property lookupRatchanan Srirattanamet2023-03-301-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')
* platform: merge branch 'lr/nl-retry'Thomas Haller2023-03-301-127/+195
|\ | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=2169512 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1537
| * platform: explicitly compare seq_result number against ↵Thomas Haller2023-03-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN We have other places like nm_assert(!out_seq_result || *out_seq_result == WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN); where we explicitly compare against WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN. Do that here too.