summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* contrib/rpm: enable -Werror on --with debug instead of --with testlr/rpm-debug-werrorLubomir Rintel2022-07-291-8/+3
| | | | | | | | | | | | | | | The test bcond is used to make test suite failure terminate the %check phase. That should generally be done for distro builds. What the distro builds shouldn't do is terminate the build on compiler warnings, because they're fairly likely to appear on toolchain updates without indicating actual bugs. However, currently that's precisely what do we do now. Let's use -Werror on debug builds instead. They are intentionally made more prone to fail (e.g. trip more runtime assertions) because failures can be more rapidly addressed and don't affect distro builds.
* release: bump version to 1.39.12 (development)1.39.12-devLubomir Rintel2022-07-292-2/+2
|
* nmcli: move an assignment down to where the value neededLubomir Rintel2022-07-291-2/+2
| | | | | | It's happier there. No change in behavior. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
* nmcli: do not assume active connection has a settings connectionLubomir Rintel2022-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | The reproducer for another problem tripped an assertion failure: $ nmcli con del act-conn Connection 'act-conn' (...) successfully deleted. $ nmcli con down another-conn (process:94552): nm-CRITICAL **: 17:07:21.170: ((src/libnm-client-impl/nm-remote-connection.c:593)): assertion '<dropped>' failed Connection 'another-conn' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4) $ What happens is that the second invocation, when resolving the connection name into a NMRemoteConnection object, assumes an active connection has a settings connection. This assumption is likely to be wrong immediately after deleting a connection was active, before giving the active connection enough time to fully deactivate. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
* bridge: fix reapply of non-bridge propertiesLubomir Rintel2022-07-291-1/+1
| | | | | | | | | Return was ommited in a branch that delegates settings check to a parent class, resulting in a bridge property check applied incorrectly. Fixes: 8e8fed433f22 ('bridge: add reapply support') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1318
* std-aux,glib-aux: merge branch 'th/misc-aux'Thomas Haller2022-07-289-183/+395
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1313
| * glib-aux: replace nm_ip4_addr_is_localhost() by ↵th/misc-auxThomas Haller2022-07-283-15/+10
| | | | | | | | | | | | nm_utils_ip4_address_is_loopback() This was duplicated.
| * glib-aux: use different name for local variables in nm_g_array_index_p() macroThomas Haller2022-07-281-10/+10
| | | | | | | | | | | | | | | | This doesn't use NM_UNIQ_T() to create a truly unique name. Instead, it avoids "_arr" as local variable name, which other macros also use. By choosing a different name, we can nest such macro calls, without getting a "-Wshadow" warning.
| * std-aux: use unique local variable in NM_IN_SET() macroThomas Haller2022-07-281-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you do: nm_assert_addr_family(NMP_OBJECT_CAST_MPTCP_ADDR(obj)->addr_family)); then there are two nested NM_IN_SET() macro invocations. Once, NMP_OBJECT_CAST_MPTCP_ADDR() checks that the object type is one of a few selected (using NM_IN_SET()). Then, that is passed to nm_assert_addr_family(), which checks NM_IN_SET(addr_family, AF_INET, AF_INET6). In general, it's easy to end up in a situation like this. And it mostly works just fine. The only problem was that NM_IN_SET() uses an internal, local variable "_x". The compiler will emit a very verbose failure about the shadowed variable: ./src/libnm-std-aux/nm-std-aux.h:802:14: error: declaration of '_x' shadows a previous local [-Werror=shadow] 802 | type _x = (x); \ NM_UNIQ_T() exists for this purpose. Use it. NM_IN_SET() is popular enough to warrant a special treatment to avoid this pitfall.
| * std-aux: add argument to "op" parameter for NM_VA_ARGS_FOREACH() macroThomas Haller2022-07-283-152/+153
| | | | | | | | | | This will be needed to pass "NM_UNIQ" to the op macro, to construct a NM_UNIQ_T() unique name.
| * std-aux: add nm_memeq() helperThomas Haller2022-07-281-0/+6
| |
| * std-aux: add c_list_insert_sorted()Thomas Haller2022-07-283-2/+212
|/ | | | | | | | | | | | The strength of CList is of course to use it as a stack of queue, and only append/remove from the front/tail. However, since this is an intrusive list, it can also be useful to just use it to track elements, and -- when necessary -- sort them via c_list_sort(). If we have a sorted list, we might want to insert a new element honoring the sort order. This function achieves that.
* release: bump version to 1.39.11 (development)1.39.11-devBeniamino Galvani2022-07-272-2/+2
|
* NEWS: updateBeniamino Galvani2022-07-271-0/+4
|
* build: fix compilationBeniamino Galvani2022-07-272-0/+3
| | | | Fixes: dbf29c54508e ('platform: fix build with musl libc')
* platform: fix build with musl libcBeniamino Galvani2022-07-276-9/+0
| | | | | | | | | | | | | | | | | | | | Don't mix <net/ethernet.h> and <linux/if_ether.h>. Fixes the following build error with musl libc: In file included from /usr/include/net/ethernet.h:10, from ../src/libnm-platform/nm-linux-platform.c:17: /usr/include/netinet/if_ether.h:115:8: error: redefinition of 'struct ethhdr' 115 | struct ethhdr { | ^~~~~~ In file included from ../src/linux-headers/ethtool.h:19, from ../src/libnm-std-aux/nm-linux-compat.h:22, from ../src/libnm-platform/nm-linux-platform.c:10: /usr/include/linux/if_ether.h:169:8: note: originally defined here 169 | struct ethhdr { | ^~~~~~ Fixes: dc98ab807ca8 ('platform: include "linux-headers" via "libnm-std-aux/nm-linux-compat.h"')
* platform: merge branch 'th/mptcp-1'Thomas Haller2022-07-2621-331/+434
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1312
| * platform: fix identity for MPTCP NMPObject to honor portThomas Haller2022-07-261-1/+3
| |
| * platform/trivial: add code comments for NMPGlobalTrackerThomas Haller2022-07-261-13/+44
| |
| * platform: rename file "nmp-route-manager.[hc]" to "nmp-global-tracker.[hc]"Thomas Haller2022-07-269-9/+9
| |
| * platform: rename NMPRouteManager to NMPGlobalTrackerThomas Haller2022-07-268-270/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkManager primarily manages interfaces in an independent fashion. That means, whenever possible, we want to have a interface specific view. In many cases, the underlying kernel API also supports that view. For example, when configuring IP addresses or unicast routes, we do so per interfaces and don't need a holistic view. However, that is not always sufficient. For routing rules and certain route types (blackhole, unreachable, etc), we need a system wide view of all the objects in the network namespace. Originally, NMPRulesManager was added to track routing rules. Then, it was extended to also track certain route types, and the API was renamed to NMPRouteManager. This will also be used to track MPTCP addresses. So rename again, to give it a general name that is suitable for what it does. Still, the name is not great (suggestion welcome), but it should cover the purpose of the API well enough. And it's the best I came up with. Rename.
| * platform: set the scope for IPv4 loopback address to "host"Thomas Haller2022-07-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For IPv6, kernel does not accept the ifa_scope parameter and always determines the scope based on the address itself. For IPv4, it honors whatever scope the user sets via netlink. NetworkManager does not allow to directly configure the address scope, but autodetects it. Use nm_platform_ip4_address_get_scope() for detecting the scopt. This also fixes the issue that to detect loopback addresses 127.0.0.0/8 and use scope "host". Try: $ nmcli device modify "$IFACE" +ipv4.addresses 127.0.0.5/8
| * platform: add nm_platform_ip{4,6,}_address_get_scope() helperThomas Haller2022-07-261-0/+31
| |
| * platform: include "linux-headers" via "libnm-std-aux/nm-linux-compat.h"Thomas Haller2022-07-263-3/+6
| | | | | | | | | | | | | | | | We have our own copy of linux kernel headers, and we must never directly include the corresponding versions from the system. Avoid that, by only including the clones via "libnm-std-aux/nm-linux-compat.h" and by including the compat wrapper header before other system headers.
| * platform: assert for success genlmsg_put() in _nl802154_alloc_msg()Thomas Haller2022-07-261-1/+2
| |
| * platform/trivial: add blank line after variable declaration in NLA_PUT_TYPE()Thomas Haller2022-07-261-0/+1
| |
| * glib-aux: add nm_ip_addr_cmp_for_sort() helper for sorting IP addressesThomas Haller2022-07-262-0/+14
| | | | | | | | | | | | | | | | It's similar to nm_ip_addr_cmp(), but it can be used as an argument to g_qsort_with_data() to sort a list of NMIPAddr (or in_addr_t or struct in6_addr). The address family needs to be given as user-data.
| * glib-aux: add nm_utils_ip4_address_is_loopback()Thomas Haller2022-07-261-2/+10
| |
| * glib-aux: add code comment to nm_ip_addr_set() about using it for NMIPAddr ↵Thomas Haller2022-07-261-1/+10
|/ | | | argument
* bridge: don't reset vlan filtering parameters on external connectionsBeniamino Galvani2022-07-261-1/+2
| | | | | | | Fixes: 96fab7b46258 ('all: add vlan-filtering and vlan-default-pvid bridge properties') https://bugzilla.redhat.com/show_bug.cgi?id=2107647 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1305
* supplicant: increase the PMK lifetime for WPA-EAPBeniamino Galvani2022-07-261-0/+42
| | | | | | | | | | | | | | | | | | | | | By default, wpa_supplicant sets these parameters according to the 802.11 standard: dot11RSNAConfigPMKLifetime = 43200 seconds (12 hours) dot11RSNAConfigPMKReauthThreshold = 70% With these, the supplicant triggers a new EAP authentication every 8 hours and 24 minutes. If the network uses one-time secrets, the reauthentication fails and the supplicant disconnects. It doesn't seem desirable that the client starts a reauthentication so early; bump the lifetime to a week. Currently, due to a bug, the new value is ignored by wpa_supplicant when set via D-Bus. This patch needs the fix at [1], not yet merged. [1] http://lists.infradead.org/pipermail/hostap/2022-July/040664.html https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1306
* bridge: add reapply supportLubomir Rintel2022-07-251-15/+82
| | | | | | | | We're able to reapply all properties in the bridge setting, aside from "mac-address" which is used for matching the device. https://bugzilla.redhat.com/show_bug.cgi?id=2092762 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1296
* manager: recreate virtual devices on "nmcli net on"Lubomir Rintel2022-07-251-6/+22
| | | | | | | | | | | | | | | | | | "nmcli networking off" brings down all connections, resulting in virtual devices disappearing: # nmcli c add type dummy ifname dummy0 # nmcli networking off # nmcli networking on # nmcli d show dummy0 Error: Device 'dummy0' not found. Attempt to recreate them all upon bringing the networking back up. Fixes-test: @ovs_cloned_mac_set_on_iface https://bugzilla.redhat.com/show_bug.cgi?id=2093175 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1292
* manager: make "nmcli net off" wait for deactivationsLubomir Rintel2022-07-251-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current behavior of "nmcli networking off" is that it starts disconnecting the devices, but doesn't wait for them to actually come down. That is not too helpful: the user never knows when the network is actually disconnected. Some users, notably the NetworkManager-CI test suite, seem to expect the devices are all disconnected after the command finishes. Even worse, it immediately proceeds activating the connections: @ovs_cloned_mac_set_on_iface ... * Execute "nmcli networking off && nmcli networking on" This results in pure utter chaos. In particular, the slave connections sometimes refuse to activate after "nmcli networking on", because the master connections are still getting disconnected in response to preceding "nmcli networking off". Let's make Enable(FALSE) and Sleep(TRUE) block until none of the devices are expected to go down. Note that this makes those call also return when Enable(TRUE) and Sleep(FALSE) is issued in meanwhile. Therefore a return from Enable(FALSE) doesn't necessarily imply the networking is disabled. This is a feature, not a bug -- the actual manager state is available in the "state" property. Fixes-test: @ovs_cloned_mac_set_on_iface https://bugzilla.redhat.com/show_bug.cgi?id=2093175 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1292
* build/meson: fix autodetecting ifcfg_rh/ifupdown pluginsThomas Haller2022-07-252-16/+13
| | | | | | | | | | | | | | | | | | "-Difcfg_rh=false" did not work, we would always fallback to autodetection. That is wrong, an explicit "false" should be honored. It's also not what autotools does. Fix this. While at it, drop "distro" variable. It's not a clear concept that can be reused and it's unused otherwise. Also, no longer let the autodetection be based on cross compilation. When cross-compiling, it seems not entirely unreasonable that you cross compile to a comparable distro, so let the autodetection be based on what we detect on the host. In any case, a user can and is encouraged to explicitly enable/disable the plugins via "-Difcfg_rh=" or "-Difupdown=". https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1310
* c-stdaux: re-import git-subtree for 'src/c-stdaux'Thomas Haller2022-07-252-1/+19
|\ | | | | | | git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
| * Squashed 'src/c-stdaux/' changes from ddd666b76654..4e78ffaea49dThomas Haller2022-07-252-1/+19
| | | | | | | | | | | | | | 4e78ffaea49d build: bump version to 1.2.0 git-subtree-dir: src/c-stdaux git-subtree-split: 4e78ffaea49dd10064be0b604b42062306de41bb
* | c-util,nettools: merge branch 'th/gitlab-ci-subtrees'Thomas Haller2022-07-2516-13/+72
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1303
| * | gitlab-ci: print git-status during do_clean() in "run-test.sh"Thomas Haller2022-07-251-0/+3
| | | | | | | | | | | | | | | | | | If we have a non-clean working directory after do_clean(), that is a bug and something we need to investigate. Print information to make that easier to debug.
| * | gitlab-ci: run unit tests for git subtree subprojectsThomas Haller2022-07-251-0/+33
| | |
| * | modules: patch meson subprojects to use local dependenciesThomas Haller2022-07-2514-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Usually we want no difference between the upstream project that we fork via git-subtree, and our copy. However, for the subprojects, we need to patch them. Do it. If you know a better way, that allows to overwriting the subprojects please send a patch.
| * | contrib: show diff of git subtrees in "git-subtree-reimport.sh" scriptThomas Haller2022-07-251-5/+26
|/ /
* | libnm: fix adding new file "nm-conn-utils.c" to translationThomas Haller2022-07-221-0/+1
| | | | | | | | | | | | Reported-by: Piotr Drąg <piotrdrag@gmail.com> Fixes: f00e747beb05 ('libnm-client: Add public nm_conn_wireguard_import() func')
* | dhcp: fix EXTENDED DHCP event to accept lease for dhclient pluginThomas Haller2022-07-222-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | n-dhcp4 only supports calling ACCEPT during the GRANTED state. Not during a EXTENDED event. So usually, we would not want to call accept in that case. And we didn't. During EXTENDED event, we would usually skip ACD (because it's either not enabled or we already passed ACD for the current address). In that case, in _nm_dhcp_client_notify() we hit the line if (client_event_type == NM_DHCP_CLIENT_EVENT_TYPE_BOUND && priv->l3cd_curr && nm_l3_config_data_get_num_addresses(priv->l3cd_curr, priv->config.addr_family) > 0) priv->l3cfg_notify.wait_dhcp_commit = TRUE; else priv->l3cfg_notify.wait_dhcp_commit = FALSE; and would not set `wait_dhpc_commit`. That means, we never called _dhcp_client_accept(). For nettools, that doesn't really matter because calling ACCEPT during EXTENDED is invalid anyway. However, for dhclient that is fatal because we wouldn't reply the D-Bus request from nm-dhcp-helper. The helper times out after 60 seconds and dhclient would misbehave. We need to fix that by also calling _dhcp_client_accept() in the case when we don't need to wait (the EXTENDED case). However, previously _dhcp_client_accept() was rather peculiar and didn't like to be called in an unexpected state. Relax that. Now, when calling accept in an unexpected state, just do nothing and signal success. That frees the caller from the complexity to understand when they must/must not call accept. https://bugzilla.redhat.com/show_bug.cgi?id=2109285 Fixes: 156d84217ced ('dhcp/dhclient: implement accept/decline (ACD) for dhclient plugin') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1308
* | build/meson: cross compile fix distroAdrian Freihofer2022-07-221-1/+3
| | | | | | | | | | | | | | In case of cross compilation the target distro is not the same as the distro of the build machine. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1309
* | c-stdaux: re-import git-subtree for 'src/c-stdaux'Thomas Haller2022-07-221-3/+0
|\ \ | |/ | | | | git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
| * Squashed 'src/c-stdaux/' changes from da7209900ef0..ddd666b76654Thomas Haller2022-07-221-1/+0
| | | | | | | | | | | | | | ddd666b76654 c-stdaux.h: don't include <stdatomic.h> git-subtree-dir: src/c-stdaux git-subtree-split: ddd666b766548a8703ba845c3d58a21bdeaf5f2e
* | man: fix letter case of values for CONNECTIVITY_STATE in ↵Thomas Haller2022-07-221-2/+3
| | | | | | | | | | | | NetworkManager-dispatcher https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1047
* | libnm: update HTTP reference to documentation in code commentThomas Haller2022-07-221-1/+1
| |
* | libnmc/trivial: rename _device_state_to_string() functionThomas Haller2022-07-211-2/+2
| | | | | | | | _device_state_externally_to_string() is a better name for what it does.