summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hostname: start a new lookup every time the DNS configuration changesbg/hostname-dns-fixBeniamino Galvani2020-12-183-4/+49
| | | | | | | | If the DNS configuration changes, the hostname previously determined via reverse DNS lookup could be stale. Clear the resolver data of every interface and try again. Fixes: 09c83871144a ('policy: use the hostname setting')
* device: log dns resolver state as stringBeniamino Galvani2020-12-171-2/+18
|
* ovs: fix leaksBeniamino Galvani2020-12-151-2/+2
| | | | Fixes: 1eeca3c606ab ('core/ovs: track external-ids for cached ovsdb objects')
* merge branch 'ffmancera/eth_prio'Beniamino Galvani2020-12-147-4/+22
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/707
| * libnm: adjust nm_device_get_type_description for VethFernando Fernandez Mancera2020-12-142-2/+8
| | | | | | | | | | | | | | | | Veth interfaces should be shown as Ethernet from nm_device_get_type_description in order to provide backward compatibility. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
| * libnm: NMDeviceEthernet uses PRIO_20 instead of PRIO_30Fernando Fernandez Mancera2020-12-145-2/+14
|/ | | | | | | | | | As NMDeviceVeth has a NMDeviceEthernet as parent, it should use PRIO_20 in order to report NMDeviceVeth when configured and do not report NMDeviceEthernet. An unit test case has been added. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
* release: bump version to 1.29.6 (development)1.29.6-devBeniamino Galvani2020-12-142-2/+2
|
* Revert "ovs: clean up interfaces from ovsdb at startup"Beniamino Galvani2020-12-141-46/+0
| | | | | | | The commit breaks ovs system interfaces on daemon restart. Revert the change until a better solution is found. This reverts commit e5113a7fd91b42ff16ff675660cdc27fae0bd80c.
* merge branch 'th/gitlab-ci-alpine' (part 2)Thomas Haller2020-12-1314-9/+28
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/704
| * systemd: don't use qsort_r() on muslRasmus Thomsen2020-12-131-0/+2
| | | | | | | | [thaller@redhat.com: modified original patch]
| * systemd: add missing definitions for __compar_d_fn_t with muslRasmus Thomsen2020-12-131-0/+7
| |
| * systemd: don't include <printf.h>Thomas Haller2020-12-131-0/+2
| | | | | | | | It doesn't exist on alpine/musl.
| * systemd: include <fcntl.h> instead of <sys/fctnl.h>Thomas Haller2020-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | On alpine/musl we get a compiler warning: CC shared/systemd/src/basic/libnm_systemd_shared_la-env-file.lo In file included from ../shared/systemd/src/basic/fileio.h:9, from ../shared/systemd/src/basic/env-file.c:10: /usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp] 1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> | ^~~~~~~
| * shared/nm-glib-aux: don't use RTLD_DEEPBIND on muslRasmus Thomsen2020-12-131-0/+10
| | | | | | | | [thaller@redhat.com: original patch modified]
| * shared: fix _POSIX_C_SOURCE not being defined for nm-errno.cThomas Haller2020-12-131-1/+1
| | | | | | | | | | | | This is the case with musl. Based-on-patch-by: Rasmus Thomsen <oss@cogitri.dev>
| * libnm: replace <netinet/ether.h> by <net/ethernet.h>/<net/if_arp.h> in ↵Thomas Haller2020-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | "nm-utils.c" Including <netinet/ether.h> with musl leads to a conflict with <linux/if_ether.h>, due to redefining ethhdr struct. As we include <linux/if_ether.h> in "nm-utils.h", that is a problem. Avoid that, by including other headers.
| * all: remove unnecessary <netinet/ether.h> includesThomas Haller2020-12-137-7/+0
|/ | | | | | | | <netinet/ether.h> with musl defines ethhdr struct, which conflicts with <linux/if_ether.h>. The latter is included by "nm-utils.h", so this is a problem. Drop includes of "netinet/ether.h" that are not necessary.
* core: log whether assertions are enabled for the buildThomas Haller2020-12-111-2/+3
|
* gitlab-ci: merge branch 'th/gitlab-ci-alpine' (part 1)Thomas Haller2020-12-117-8/+124
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/704
| * gitlab-ci: enable test build on alpine linuxThomas Haller2020-12-116-6/+122
| | | | | | | | | | | | | | | | | | | | | | | | Alpine is especially interesting because it uses musl as libc. The build does not yet succeed. There are several issues that need to be fixed. However, it will be simpler to fix things, if we have tests in place -- even if at the moment they are known to be broken. See-also: https://git.alpinelinux.org/aports/tree/community/networkmanager?h=master
| * gitlab-ci: update used "ci-templates" versionThomas Haller2020-12-112-6/+6
|/
* gitlab-ci: fix failure to enable PowerTools on CentOS8 buildThomas Haller2020-12-112-3/+4
| | | | | Seems that the repository was renamed (or can sometimes have a different name). Try both the "PowerTools" and "powertools" name.
* man,cloud-setup: merge branch 'th/man-nm-cloud-setup'Thomas Haller2020-12-118-5/+293
|\ | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1867997 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/600 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/701
| * man: add `man 8 nm-cloud-setup`Thomas Haller2020-12-117-0/+281
| | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1867997 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ ## 600
| * cloud-setup: simplify cancellation in _get_config_fetch_cancelled_cb()Thomas Haller2020-12-111-4/+1
| | | | | | | | | | | | | | | | | | | | If we call g_cancellable_connect() on a GCancellable that is already cancelled, then the callback is invoked synchronously. We need to handle that. However, we can slightly simplify the code. There is no change in behavior, but we can always let the cancelled callback return the result.
| * cloud-setup: in EC2's _get_config_task_maybe_return() cancel internal ↵Thomas Haller2020-12-111-0/+2
| | | | | | | | | | | | | | | | requests on any error "iface_data->cancellable" is an internal cancellable for the parallel HTTP requests. Once we encounter a failure, those requests are all obsolete and must be cancelled.
| * cloud-setup: fix handling cancellation of internal GET operation for EC2 ↵Thomas Haller2020-12-111-1/+9
|/ | | | | | | | | | | | | | | | | provider There are two GCancellable at work: one is provided by the user during nmcs_provider_get_config(), and one is used internally for the individual HTTP GET requests. In _get_config_fetch_done_cb(), if the error reason is "cancelled", then it means that our internal iface_data->cancellable was cancelled. Probably because an error happend (like a timeout or the user cancelled the external GCancellable). In that case, we must not report that the task completed with a cancellation, because we need to preserve the error that was the original cause.
* all: avoid GNU "which" from shell scriptsThomas Haller2020-12-119-14/+14
| | | | | | "which" is a separate package and may not be installed. Also, shell has a built-in command for the same purpose. Use that.
* tools: improve detection of "ci-fairy" command in "tools/check-gitlab-ci.sh"Thomas Haller2020-12-111-1/+1
| | | | | | | | | The previous implementation would print ./tools/check-gitlab-ci.sh: line 22: ci-fairy: command not found also, it's not nice to execute the program, just to find out whether we have it.
* tests: skip "check-local-gitlab-ci" test on gitlab-ciThomas Haller2020-12-111-0/+6
|
* tests: allow to skip check-local-gitlab-ci via "$NMTST_SKIP_CHECK_GITLAB_CI"Thomas Haller2020-12-111-0/+4
| | | | | | | | | | | This will be used on our gitlab-ci tests. We do have a separate, dedicated test on gitlab-ci for checking that "gitlab-ci.yml" is correct. We may intentionally want to violate that condition, but then our `make check` should not fail. Add a way to skip that test.
* libnm: suppress "-Warray-bounds" warning in nm_team_link_watcher_new_ethtool()Thomas Haller2020-12-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc-11.0.0-0.7.fc34 warns here: CC libnm-core/libnm_core_la-nm-setting-team.lo libnm-core/nm-setting-team.c: In function ‘nm_team_link_watcher_new_ethtool’: libnm-core/nm-setting-team.c:127:33: error: array subscript ‘NMTeamLinkWatcher[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] 127 | watcher->ref_count = 1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ libnm-core/nm-setting-team.c:125:15: note: referencing an object of size 16 allocated by ‘g_malloc’ 125 | watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libnm-core/nm-setting-team.c:128:33: error: array subscript ‘NMTeamLinkWatcher[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] 128 | watcher->type = LINK_WATCHER_ETHTOOL; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ libnm-core/nm-setting-team.c:125:15: note: referencing an object of size 16 allocated by ‘g_malloc’ 125 | watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libnm-core/nm-setting-team.c:129:33: error: array subscript ‘NMTeamLinkWatcher[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] 129 | watcher->ethtool.delay_up = delay_up; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ libnm-core/nm-setting-team.c:125:15: note: referencing an object of size 16 allocated by ‘g_malloc’ 125 | watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libnm-core/nm-setting-team.c:130:33: error: array subscript ‘NMTeamLinkWatcher[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] 130 | watcher->ethtool.delay_down = delay_down; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ libnm-core/nm-setting-team.c:125:15: note: referencing an object of size 16 allocated by ‘g_malloc’ 125 | watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Maybe we should not use this trick and just malloc() a struct of the intended size, however: - the code below does a similar thing, doing it differently for ethtool watcher is confusing. - the NMTeamLinkWatcher is a union which cannot alter its type. In no case is it correct to access the fields of the wrong union type. By allocating a smaller chunk, valgrind might catch such bugs. Also, NMTeamLinkWatcher's definition is private to the C source file, in no case must anybody assume that the rest of the buffer actually exists. Hence, workaround the warning by suppressing it.
* libnm: merge branch 'th/ovs-external-ids-for-system-interface'Thomas Haller2020-12-114-77/+135
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/702
| * libnm: allow OVS external-ids also for system interfaceThomas Haller2020-12-112-13/+31
| | | | | | | | | | Note that reapply currently does not work for OVS system interface. That is, because the code does not make it easy to implement that.
| * libnm: move detection/normalization of "connection.slave-type" to a separate ↵Thomas Haller2020-12-112-64/+104
|/ | | | | | | | | | | | function We allow normalizing the slave-type, but sometimes, we may want to validate a profile according to the set slave-type. For example, a "ovs-external-ids" setting should only be allowed for "connection.slave-type=ovs-interface". But during verify, the slave-type may be missing and not yet normalized. We need to be able to obtain the actually used slave-type.
* build: merge branch 'maxice8:reallocarray-in-stdlib' into masterThomas Haller2020-12-102-1/+3
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/703
| * build: check for reallocarray in stdlib.hLeo2020-12-101-0/+1
| |
| * build/meson: check for reallocarray in stdlib.h tooLeo2020-12-101-1/+2
|/ | | | | | | | | | musl added support for reallocarray, but the function prototype is declared in stdlib.h instead of malloc.h. Update the check for reallocarray to check both in malloc.h and stdlib.h. https://man7.org/linux/man-pages/man3/reallocarray.3.html
* wifi: fix evaluating the scanning state for wpa-supplicantThomas Haller2020-12-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | wpa_supplicant has a property "scanning" and a "state=scanning". Previously, NetworkManager considered both parts to indicate whether supplicant is currently scanning (if either the property or the state indicated scanning, it took that as indication for scanning). If NetworkManager thinks that supplicant is scanning, it suppresses explicit "Scan" requests. That alone is not severe, because the "Scan" request is only to trigger a scan in supplicant (which supplicant possibly is already doing in state "scanning"). However, what is severe is that NetworkManager will also block autoconnect while supplicant is scanning. That is because NetworkManager wants to get a complete scan result before deciding which network to connect to. It seems that wpa_supplicant can get into "state=scanning" and stay there indefinitely. This prevents NetworkManager from autoactivating a profile. Fix that, to only honor the "scanning" property. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/597 Fixes: b83f07916a54 ('supplicant: large rework of wpa_supplicant handling')
* libnm: add warning for bindings about broken functions for transferred GPtrArrayThomas Haller2020-12-092-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 201c153e2599 ('libnm: fix GObject Introspection annotations for functions returning a GPtrArray') these annotations were changed to fix Vala bindings. However, bindings may treat the transfer annotation for GPtrArray differently, so depending on the binding we either get a leak or a double free. It's unclear how to fix that. For now, just add a warning to the documentation to avoid it. The following reproducer leads to a crash: #!/bin/python import gi gi.require_version("NM", "1.0") from gi.repository import NM def _pr(msg): NM.utils_print(0, msg + "\n") def process(nmc): for device in nmc.get_devices(): cons = device.filter_connections(nmc.get_connections()) _pr( "device %s (%s) has %s compatible connections" % (device.get_iface(), NM.Object.get_path(device), len(cons)) ) process(NM.Client.new()) See-also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/305
* keyfile: fix error message on failure to generate filename in ↵Thomas Haller2020-12-091-1/+9
| | | | _internal_write_connection()
* shared: fix race in nm_ref_string_unref()Thomas Haller2020-12-081-8/+9
| | | | | | | | | | | | | | | | We cannot drop the reference count to zero while having no lock. Otherwise, another thread might race doing s = nm_ref_string_new("..."); nm_ref_string_unref(s); and already successfully delete the instance. Hitting this race should be rather difficult, especially because we tend to use NMRefString only from one thread. But still, access to global variables must be race free. Fixes: 908fadec964e ('shared: add NMRefString')
* libnm: fix re-entrancy of NMClient.dispose() for _init_release_all()Thomas Haller2020-12-081-2/+2
| | | | | | | | | | GObject's dispose() functions may be called multiple times to break reference cycles. As dispose() calls _init_release_all(), the object might already be partially destroyed. Fixes: ce0e898fb476 ('libnm: refactor caching of D-Bus objects in NMClient')
* libnm: add debug logging for creating/destroying NMObjectThomas Haller2020-12-071-0/+10
|
* ovs: clean up interfaces from ovsdb at startupbg/ovs-cleanup-rh1861296Beniamino Galvani2020-12-071-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | During shutdown, NM always tries to remove from ovsdb all bridges, ports, interfaces that it previously added. Currently NM doesn't run the main loop during shutdown and so it's not possible to perform asynchronous operations. In particular, the NMOvsdb singleton is disposed in a destructor where it's not possible to send out all the queued deletions. The result is that NM deletes only one OVS interface, keeping the others. This needs to be fixed, but requires a rework of the shutdown procedure that involves many parts of NM. Even when a better shutdown procedure will be implemented, we should support an unclean shutdown caused by e.g. a kernel panic or a NM crash. In these cases, the interfaces added by NM would still linger in the ovsdb. Delete all those interface at NM startup. If there are connections profiles for them, NM will create them again. https://bugzilla.redhat.com/show_bug.cgi?id=1861296 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/700
* NEWS: belatedly mention systemd-resolved change in NEWSThomas Haller2020-12-071-0/+2
|
* release: bump version to 1.29.5 (development)1.29.5-devThomas Haller2020-12-06313-10020/+20740
|\
| * contrib/release: check NEWS file before releaseThomas Haller2020-12-061-1/+29
| |
| * l3cfg: avoid "-Werror=maybe-uninitialized" warning in _load_link()Thomas Haller2020-12-061-2/+2
| | | | | | | | | | It's not actually an issue, but the compiler might think that we use nacd_old_addr without initialization.
| * contrib/rpm: update default for main.plugins setting in NetworkManager.confThomas Haller2020-12-061-1/+1
| | | | | | | | | | | | | | With Fedora 33+ and RHEL 9+, the default plugins are "plugins=keyfile,ifcfg-rh", instead of "plugins=ifcfg-rh,keyfile". Update our "NetworkManager.conf" file to reflect that.