summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ovs: perform the initial cleanup only on first startbg/rh1861296-pt2Beniamino Galvani2020-12-111-0/+4
| | | | | | | | | | | | | | | | When NM is restarted, devices can be "assumed": NM tracks what was the connection active before the restart and after the restart bypasses most of the setup phases, bringing the device into the activate state. When an OVS system interface is assumed after a daemon restart, it can reach the activated state even before NM connects to the ovsdb. Later, upon connection to ovsdb, the cleanup of initial OVS interfaces wrongly deletes the interface record. Perform the initial ovsdb cleanup only during the first start. Fixes: e5113a7fd91b ('ovs: clean up interfaces from ovsdb at startup') https://bugzilla.redhat.com/show_bug.cgi?id=1861296
* 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.
| * policy: remove unused code from "nm-policy.c" for reverse DNS lookup for ↵Thomas Haller2020-12-041-100/+1
| | | | | | | | | | | | | | | | | | | | | | hostname By now, each NMDevice does the reverse lookup and caches the result via nm_device_get_hostname_from_dns_lookup(). The code is no longer used in NMPolicy. Fixes: 09c83871144a ('policy: use the hostname setting')
| * contrib/rpm: support default options for debug,test in generated spec fileThomas Haller2020-12-033-7/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "build_clean.sh" (and "build.sh") scripts can both create a source tarball (via `make dist`/`make distcheck`), an SRPM (and a spec file), or build RPMs from the SRPM. Note that the generated spec file has various options, like %bcond_without nmtui %bcond_without debug %bcond_without test When building an RPM from the SRPM, you can specify the "--with" or "--without" option for rpmbuild. This is also what the "-w" / "-W" options for "build_clean.sh" do. However, the SRPM still has the intrinsic defaults, and if you later build an RPM from it, you would have to pass "--with" / "--without" to rpmbuild. Often that is not conveniently possible, for example, when you build the SRPM in koji. Extend the scripts so that also the defaults for "-w debug" and "-w test" can be specified when generating the SRPM. You can do that with the new options "--default-for-{debug,test}" to "build_clean.sh". Alternatively, it suffices to specify the previously supported "-w" / "-W" options. That way, we will pass those options to rpmbuild, but also set them as defaults in the generate spec file. The new options "--default-for-{debug,test}" are only needed if you want the default in the spec file to be different then what you use when creating the SRPM.
| * contrib/rpm: add "--no-auto-with-test" option for "build_clean.sh" scriptThomas Haller2020-12-031-0/+8
| | | | | | | | | | | | | | | | | | By default, "build_clean.sh" script likes to automatically add "-w test" -- unless the user specified "-w test" or "-W test" on the command line. That is mostly fine. However, the spec file has an internal default for the "test" option. So if you want to use the default that gets determined by the spec file, then we should suppress that automatism.
| * contrib/rpm: drop no longer supported "--enable-json-validation" from configureThomas Haller2020-12-031-2/+1
| | | | | | | | Fixes: bbb1f5df2f23 ('libnm: always build libnm with JSON validation')
| * build: ignore "docs/api/NetworkManager.actions" build artifactThomas Haller2020-12-033-11/+25
| | | | | | | | | | | | I still don't understand why we get now these ".actions" build artifacts. Anyway, I don't think we need to care. Just ignore it.
| * core: fix warning about unused variable in _l3_acd_data_add_all()Thomas Haller2020-12-031-6/+6
| | | | | | | | | | | | | | src/nm-l3cfg.c: In function _l3_acd_data_add_all: src/nm-l3cfg.c:1557:14: error: unused variable i [-Werror=unused-variable] 1557 | guint i; | ^
| * release: bump version to 1.29.4 (development)1.29.4-devThomas Haller2020-12-032-2/+2
| |
| * man: better explain default connection settings in `man NetworkManager.conf`Thomas Haller2020-12-031-2/+14
| |
| * policy: fix hostname lookup from DNSBeniamino Galvani2020-12-021-1/+1
| | | | | | | | Fixes: 09c83871144a ('policy: use the hostname setting')
| * veth: peer property is D-Bus object path not a stringFernando Fernandez Mancera2020-12-012-27/+22
| | | | | | | | Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
| * dns: sd-resolved: fix hash table iterationBeniamino Galvani2020-11-301-1/+3
| | | | | | | | | | | | g_hash_table_iter_next() wants a (gpointer *), not an (int *). Fixes: f70ee67058c9 ('dns: sd-resolved: reset interface configuration on deactivation')
| * manager: return most recent connection in active_connection_find()bg/ac-orderBeniamino Galvani2020-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | When a connection is reactivated, there could be two active connections tracked by the manager: the deactivating one and the new one. Ensure that we first return the most recent one so that slaves will pick the right master. Fixes-test: @iptunnel_gretap_doc_procedure Fixes: dc6ec6ce7b8d ('core: reverse the order of active connections in the manager') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/697
| * po: update Ukrainian (uk) translationYuri Chornoivan2020-11-301-485/+509
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/698
| * release: bump version to 1.29.3 (development)1.29.3-devBeniamino Galvani2020-11-272-2/+2
| |
| * dns: merge branch 'th/dns-resolved-default-route'Thomas Haller2020-11-271-47/+107
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/694
| | * dns: detect support of systemd-resolved's SetLinkDefaultRoute() and avoid itThomas Haller2020-11-271-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now always use SetLinkDefaultRoute(), but that API was only added in systemd v240 ([1]). We could just always call the non-existing method, and ignore the error. However, that feels ugly. Would systemd-resolved log warnings about that? Should we suppress all messages about that failure (not good for debugging). Instead, make an effort to detect support of the function, and avoid calling it. That is significantly more complicated than just always calling the method and not care. Note that even if systemd-resolved does not support SetLinkDefaultRoute(), we cannot do anything smart about that. We would simply rely on systemd-resolved (hopefully) doing the right thing automatically. That's better and simpler than explicitly adding a "~." domain in the fallback case. Also, detecting support is straight forward in the common case, where there is either success or a clear "org.freedesktop.DBus.Error.UnknownMethod" error. In cases where there is any other failure, we don't really know. In that case, we keep trying to use the API under the assumption that it should work. [1] https://github.com/systemd/systemd/commit/7 ## 7673795dcf5797491e7f785cbf5077d29a15db4
| | * dns: preserve DNS settings for systemd-resolved to resendThomas Haller2020-11-271-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the DNS settings change, we update the request_queue_lst_head list, with all the requests we want to send. Then, send_updates() will try to send it. It might not do it right away, if resolved is not on the bus or the D-Bus connection is not fully inialized (meaning, we don't know the name owner yet). In those cases, we would keep the list of requests, and send them later. However, when sending them, we would also forget about the configuration. That means, if you restart systemd-resolved, then the daemon drops off the bus and reappears. I think that systemd-resolved in fact persists the configuration during restart. So, usually the settings are still the same after restart. However, we should do better here: if the service appears, we should send the settings again. This means to not forget the requests after we send them once -- at least, until a new update replaces them.
| | * dns: minor cleanup of call_done() in "nm-dns-systemd-resolved.c"Thomas Haller2020-11-271-12/+27
| | |
| | * dns: cleanup RequestItem and track ifindex and self parameterThomas Haller2020-11-271-28/+43
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will need these changes next: - add "self" and "ifindex" fields to RequestItem struct. We will pass on these structs are user-data for the callbacks, so that we afterwards know which request completed. - add DBUS_OP_SET_LINK_DEFAULT_ROUTE global variable. We don't clone the "operation" string but use string literals. However, string literals are not guaranteed to be deduplicated, so we should only compare them with strcmp(). The static variable avoids this: we can use pointer equality to compare it. This will be used next.
| * veth: merge branch 'ffmancera:veth_support'Thomas Haller2020-11-2727-64/+639
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/682
| | * veth: add support to configure veth interfacesFernando Fernandez Mancera2020-11-2726-43/+603
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkManager is now able to configure veth interfaces throught the NMSettingVeth. Veth interfaces only have "peer" property. In order to support Veth interfaces in NetworkManager the design need to pass the following requirements: * Veth setting only has "peer" attribute. * Ethernet profiles must be applicable to Veth interfaces. * When creating a veth interface, the peer will be managed by NetworkManager but will not have a profile. * Veth connection can reapply only if the peer has not been modified. * In order to modify the veth peer, NetworkManager must deactivate the connection and create a new one with peer modified. In general, it should support the basis of veth interfaces but without breaking any existing feature or use case. The users that are using veth interfaces as ethernet should not notice anything changed unless they specified the veth peer setting. Creating a Veth interface in NetworkManager is useful even without the support for namespaces for some use cases, e.g "connecting one side of the veth to an OVS bridge and the other side to a Linux bridge" this is done when using OVN kubernetes [1][2]. In addition, it would provide persistent configuration and rollback support for Veth interfaces. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1885605 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1894139 Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
| | * ethernet: define NMDeviceEthernet on nm-libnm-utils.hFernando Fernandez Mancera2020-11-272-21/+36
| |/ | | | | | | | | | | | | NMDeviceEthernet will be used to support Veth interfaces. Therefore, it needs to be defined on libnm/nm-libnm-utils.h Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
| * core: recognize "wifi.scan-generate-mac-address-mask" as valid ↵Thomas Haller2020-11-273-7/+10
| | | | | | | | | | | | | | | | "NetworkManager.conf" option Fixes: 32f4abe90b72 ('config: warn about unknown keys in config files') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/595
| * contrib/rpm: on rhel-9 let a test failure or compiler warning fail the buildThomas Haller2020-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always run the unit tests during package build and also enable all compiler warnings. However, by default we used to ignore failures. That is, because rebuilding a package on another, future distro led to frequent, annoying build failures. Especially compiler warnings appear easily when using a different compiler version. The default mostly matters here when you want to build the package in brew/koji, where you don't have a possibility to explicitly select the build option. Note that rpmdiff detects failures in the build log, and thus we usually would not miss failures for builds we add to errata. Also, all our CI tests build packages with a manner where they would not allow a failure of the unit tests. So, we run these unit tests frequently and in a manner where we notice a failure. For rhel-9 builds, change the default here and let test failures and compiler warnings be fatal to the build.
| * ovs: merge branch 'bg/rh1899745'Beniamino Galvani2020-11-261-13/+29
| |\ | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1899745 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/691
| | * ovs: avoid ovs error when same MAC is set on a local interface and bridgebg/rh1899745Beniamino Galvani2020-11-261-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the same MAC address is set on both the bridge connection and the interface connection, and the interface is local, NM currently sets the hwaddr record in both Bridge and Interface ovsdb tables. As a result, ovs complains with error: bridge|ERR|interface br0: ignoring mac in Interface record (use Bridge record to set local port's mac) Avoid this error: if the bridge and interface MACs are the same, just set the address in the Bridge table; if they are different, give a more detailed warning and ignore the interface MAC. https://bugzilla.redhat.com/show_bug.cgi?id=1899745
| | * ovs: rename variableBeniamino Galvani2020-11-261-9/+9
| |/ | | | | | | | | @interface_is_internal is a bad name. The variable indicates whether the interface is the local interface.
| * initrd: fix parsing of ip= arguments with empty first tokenbg/initrd-ip-empty-rh1900260Beniamino Galvani2020-11-262-11/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser checks if the first token of an ip= argument is an IP address to determine which of the two possible syntaxes is used: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<mtu>][:<macaddr>]] This works as long as the first token is not empty, which - according to the dracut.cmdline man page - seems to be guaranteed. However, the network-legacy dracut plugin accepts an empty interface or client IP. Also, if a user needs DHCP and wants to specify a hostname, the only possible syntax is: ip=::::<hostname>::dhcp Change the parser to check the second token instead, similarly to what the network-legacy module does [1]. [1] https://github.com/dracutdevs/dracut/blob/050/modules.d/40network/net-lib.sh#L490 https://bugzilla.redhat.com/show_bug.cgi?id=1900260 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/693
| * trivial: fix coding styleThomas Haller2020-11-241-2/+1
| |
| * gitlab-ci: add CentOS 7.9 and 8.2 imagesThomas Haller2020-11-242-4/+66
| |
| * dns: fix setting systemd-resolved name servers for default routeBeniamino Galvani2020-11-241-1/+2
| | | | | | | | | | | | | | If the interface is the DNS default route but has no domain, its name servers were not sent to systemd-resolved. Fix this. Fixes: ee9fab03613e ('dns: fix handling default routing domains with systemd-resolved')
| * scripts: allow marking commits with "Ignore-Backport:" in "find-backports" ↵Thomas Haller2020-11-241-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | script "find-backports" searches commit messages of upstream branches for "Fixes:" comments. Those will then be highlighted to be backported, if the script determines that to be necessary. "find-backports" also honors the "cherry picked from" comments, to detect when a patch was already backported. That is thus a way to suppress reporting a commit to be backported. Add another way to flag commits so they don't need backporting. Via "Ignore-Backport:" tag. As "find-backports" also honors "refs/notes/bugs" notes, this can be used like: git notes \ --ref refs/notes/bugs \ append \ -m "Ignore-Backport: e""29f00fa0c69 ('NEWS: fix entry that is targeted for 1.30 instead of 1.28')" \ 2''3364aa8f3bd6b11e2ac9e30117eaabfe1f3a9f2
| * NEWS: move entry that was backported to 1.28Beniamino Galvani2020-11-241-4/+4
| |
| * dns: merge branch 'th/ip-config-cleanups' into masterThomas Haller2020-11-2413-258/+318
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/689