summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm: keep context-busy-watcher of NMClient alive for one more idle roundth/client-object-manager-dbus-leakThomas Haller2020-01-141-0/+26
| | | | | | | | | | | | | | | | | The context-busy-watch has two purposed: 1) it allows the user to watch whether the NMClient still has pending GSource'es attached to the GMainContext. 2) thereby, it also keeps the inner GMainContext integrated into the caller's. Especially for 2), we must not get this wrong. Otherwise, we might un-integrate the inner GMainContext too early and it will be leaked indefinitely (because the user has no means to access or iterate it). To be extra careful, extend the lifetime of the context-busy-watcher for one more idle invocation. Theoretically, this should not be necessary, but it's not clear whether something else is still pending.
* shared: remove nm_dbus_connection_signal_subscribe_object_manager() helperThomas Haller2020-01-144-125/+21
| | | | | | It seems to complicate things more than helping. Drop it. What we still have is a wrapper around plain g_dbus_connection_signal_subscribe(). That one is trivial and helpful. The previous wrapper seems to add more complexity.
* core/bluetooth: don't use nm_dbus_connection_signal_subscribe_object_manager()Thomas Haller2020-01-141-13/+46
| | | | | | | | | | | | nm_dbus_connection_signal_subscribe_object_manager() wraps the subscription. The problem is that this requires to pass a destroy notify function for cleaning up. Such a destroy notify function will result in an idle source when unsubscribing, which keeps the associated GMainContext alive (until it gets iterated some more). That seems error prone and outright unsuitable for NMClient. While the helper may be useful, it cannot be used by NMClient. So, there is only one user of this function and we don't expect a second one. It seems better to get rid of this wrapper and implement it directly.
* libnm: avoid leaking GMainContext for sync initialization after ↵Thomas Haller2020-01-141-14/+49
| | | | | | | | | | | | | | | | | | | context-busy-watcher quits When passing a destroy notify to g_dbus_connection_signal_subscribe(), that callback gets invoked as an idle handler of the associated GMainContext. That caused to have yet another source attached to the context after the NMClient gets destroyed. Especially with synchronous initialization of NMClient that is bad, because we may destroy the context-busy-watcher too early. That results in removing the integration of the inner GMainContext into the caller's context, and thus we leak the inner context indefinitely. Avoid that leak by not passing a cleanup function to g_dbus_connection_signal_subscribe(). Fixes: ce0e898fb476 ('libnm: refactor caching of D-Bus objects in NMClient')
* shared: add nm_source_func_unref_gobject() helperThomas Haller2020-01-141-0/+8
|
* merge: branch 'bg/vrf'Beniamino Galvani2020-01-1447-11/+1113
|\ | | | | | | | | | | Add support for virtual routing and forwarding (VRF) interfaces. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/375
| * core,libnm: add VRF supportBeniamino Galvani2020-01-1421-3/+647
| | | | | | | | | | | | | | | | Add VRF support to the daemon. When the device we are activating is a VRF or a VRF's slave, put routes in the table specified by the VRF connection. Also, introduce a VRF device type in libnm.
| * platform: add VRF supportBeniamino Galvani2020-01-149-0/+174
| | | | | | | | Add support for creating and parsing VRF links.
| * ifcfg-rh: add support for VRF slavesBeniamino Galvani2020-01-144-1/+24
| | | | | | | | | | | | Even if the ifcfg-rh plugin doesn't support VRF connections, it must be able to read and write other connection types that have a VRF master.
| * libnm-core,cli: add VRF settingBeniamino Galvani2020-01-1417-7/+268
|/ | | | | Add new VRF setting and connection types to libnm-core and support them in nmcli.
* all: merge branch 'th/unix-fd-source'Thomas Haller2020-01-1316-174/+240
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/378
| * session-monitor: don't use GIOChannel to watch plain file descriptorThomas Haller2020-01-131-9/+13
| |
| * lndp: don't use GIOChannel to watch plain file descriptor for socketThomas Haller2020-01-131-14/+19
| |
| * platform: don't use GIOChannel to watch plain file descriptor for netlink socketThomas Haller2020-01-131-21/+17
| |
| * acd: don't use GIOChannel to watch plain file descriptor for event fdThomas Haller2020-01-131-13/+21
| |
| * dhcp/nettools: don't use GIOChannel to watch plain file descriptor for event fdThomas Haller2020-01-131-7/+11
| |
| * bluez: don't use GIOChannel to watch plain file descriptor for rfcommThomas Haller2020-01-131-11/+12
| |
| * bluez: don't use GIOChannel to watch plain file descriptorThomas Haller2020-01-131-41/+48
| | | | | | | | | | Also, don't track the GSource via the guint ID but the full GSource pointer.
| * cli: don't use GIOChannel to watch plain file descriptor for ↵Thomas Haller2020-01-131-7/+13
| | | | | | | | nmc_readline_helper()
| * tui: don't use GIOChannel to watch plain file descriptor for key pressThomas Haller2020-01-131-14/+10
| |
| * shared/udev: don't use GIOChannel to watch plain file descriptorThomas Haller2020-01-131-11/+9
| |
| * all: use nm_g_unix_fd_source_new() instead of g_unix_fd_source_new()Thomas Haller2020-01-134-23/+37
| | | | | | | | | | Its source-func argument has the right signature. Otherwise, this is an easy to make mistake.
| * shared: add nm_g_unix_fd_source_new() helperThomas Haller2020-01-132-1/+28
| |
| * platform: use NM_MAKE_STRV() in NMLinuxPlatform:constucted()Thomas Haller2020-01-131-1/+1
| |
| * shared: use G_SOURCE_FUNC() macro in "shared/nm-test-utils-impl.c"Thomas Haller2020-01-131-1/+1
| |
| * tui: fix signature for nmt_newt_form_keypress_callback() callbackThomas Haller2020-01-131-1/+1
|/ | | | Fixes: 3bda3fb60c10 ('nmtui: initial import of nmtui')
* shared: improve nm_free_secret() to clear entire memory bufferThomas Haller2020-01-092-8/+27
| | | | | | | | | | The purpose is to clear the entire available buffer, not only up to the first '\0'. This is done, because otherwise we might leak sensitive data that happens to be after the first '\0', or we might give away the length of the secrets. Of course, those are very (very) minor concerns. But avoiding them is easy enough.
* po: update Ukrainian (uk) translationYuri Chornoivan2020-01-091-1308/+1309
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/388
* license: add Beniamino Galvani to RELICENSE.mdThomas Haller2020-01-091-0/+1
| | | | https://mail.gnome.org/archives/networkmanager-list/2020-January/msg00011.html
* n-dhcp4: use C_CLAMP() macro instead of c_clamp()Beniamino Galvani2020-01-091-1/+1
| | | | | | | | | | | | | | | The latter requires __auto_type which is not available in GCC versions older than 4.9. Fix the following compile error on RHEL 7.8: CC src/src_libNetworkManagerBase_la-NetworkManagerUtils.lo shared/n-dhcp4/src/n-dhcp4-c-probe.c: In function 'n_dhcp4_client_probe_transition_nak': shared/n-dhcp4/src/n-dhcp4-c-probe.c:1008:17: error: unknown type name '__auto_type' probe->ns_nak_restart_delay = c_clamp(probe->ns_nak_restart_delay * 2, ^ shared/n-dhcp4/src/n-dhcp4-c-probe.c:1008:17: error: unknown type name '__auto_type' shared/n-dhcp4/src/n-dhcp4-c-probe.c:1008:17: error: unknown type name '__auto_type' Fixes: 218782a9a3c3 ('n-dhcp4: restart the transaction after a NAK')
* license: add RELICENSE.md file to track consent/disapproval for relicensing ↵th/relicenseThomas Haller2020-01-091-0/+74
| | | | under LGPL-2.1+
* platform,device: merge branch 'th/device-ip-tunnel-mac'Thomas Haller2020-01-0910-1129/+618
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/377
| * core: set MAC address for IP tunnels when creating deviceThomas Haller2020-01-092-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is however a serious issue currently: when NetworkManager creates virtual devices, it starts from an unrealized NMDevice, creates the netdev device, realizes the device, and transitions through states UNMANAGED and DISCONNECTED. Thereby, the state of NMDevice gets cleared again. That means, if the profile has "connection.stable-id=${RANDOM}" and "ethernet.cloned-mac-address=stable", then we will first set a random MAC address when creating the device. Then, the NMDevice transitions through UNMANAGED state, forgets the MAC address it generated and creates a new MAC address in stage 1. This should be fixed by better handling unrealized devices. It also affects all software devices that set the MAC address upon creation of the interfaces (as they all should).
| * platform: support setting MAC address during nm_platform_link_gre_add()Thomas Haller2020-01-093-3/+10
| | | | | | | | We should set the MAC address of devices early on, and not later.
| * platform: drop NMPlatformLnkMacvtap typedefThomas Haller2020-01-094-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In several cases, the layer 2 and layer 3 type are very similar, also from kernel's point of view. For example, "gre"/"gretap" and "ip6tnl"/"ip6gre"/"ip6gretap" and "macvlan"/"macvtap". While it makes sense that these have different NMLinkType types (NM_LINK_TYPE_MACV{LAN,TAP}) and different NMPObject types (NMPObjectLnkMacv{lan,tap}), it makes less sense that they have different NMPlatformLnk* structs. Remove the NMPlatformLnkMacvtap typedef. A typedef does not make things simpler, but is rather confusing. Because several API that we would usually have, does not exist for the typedef (e.g. there is no nm_platform_lnk_macvtap_to_string()). Note that we also don't have such a typedef for NMPlatformLnkIp6Tnl and NMPlatformLnkGre, which has the same ambiguity between the link type and the struct with the data.
| * platform: implement link_macvlan_add via nm_platform_link_add()Thomas Haller2020-01-093-89/+31
| |
| * platform: implement link_macsec_add via nm_platform_link_add()Thomas Haller2020-01-093-101/+43
| |
| * platform: implement link_ipip_add via nm_platform_link_add()Thomas Haller2020-01-093-83/+32
| |
| * platform: implement link_ip6gre_add via nm_platform_link_add()Thomas Haller2020-01-093-108/+48
| |
| * platform: implement link_ip6tnl_add via nm_platform_link_add()Thomas Haller2020-01-093-97/+45
| |
| * platform: implement link_6lowpan_add via nm_platform_link_add()Thomas Haller2020-01-093-74/+9
| |
| * platform: implement link_vxlan_add via nm_platform_link_add()Thomas Haller2020-01-094-140/+66
| |
| * platform: implement link_vlan_add via nm_platform_link_add()Thomas Haller2020-01-094-127/+76
| |
| * platform: implement link_sit_add via nm_platform_link_add()Thomas Haller2020-01-093-79/+31
| |
| * platform: implement link_gre_add via nm_platform_link_add()Thomas Haller2020-01-093-92/+45
| |
| * platform: add parent argument to nm_platform_link_add()Thomas Haller2020-01-094-14/+27
| | | | | | | | This is to set the IFLA_LINK parameter.
| * platform: move special link-add functions to headerThomas Haller2020-01-092-91/+60
| | | | | | | | | | These are thin abstractions over nm_platform_link_add(). Move them to the header.
| * platform: extend nm_platform_link_add() to accept type specific extra parameterThomas Haller2020-01-094-35/+63
| | | | | | | | This will be used to unify all link-add implementation.
| * platform: log name of link that gets added by nm_platform_link_add()Thomas Haller2020-01-091-4/+6
| |
| * device: avoid assertion failure when setting MAC address of unexpected ↵Thomas Haller2020-01-091-2/+4
|/ | | | | | | | | | address length IP tunnels honor ethernet.cloned-mac-address. That is a MAC address of 6 bytes (ETH_ALEN). Note that for example for gre tunnels, kernel exposes an address 00:00:00:00. Hence, trying to set ethernet.cloned-mac-address with an gre tunnel leads to an assertion failure. Instead, report and log a regular error.