summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* auth-chain: drop unused nm_auth_chain_get_data_ulong()th/miscThomas Haller2018-04-042-33/+0
|
* auth-chain: use CList for tracking pending authentication requestsThomas Haller2018-04-041-67/+52
|
* shared: add nm_c_list_contains_entry() helperThomas Haller2018-04-041-0/+7
|
* core: drop unnecessary #if WITH_POLKIT from nm-auth-subject.hThomas Haller2018-04-042-8/+0
| | | | | We rely on the linker to throw away unused functions. No need for the #if in this case.
* ifcfg-rh: suppress warning about NM_CONTROLLED=no without restricting ↵Thomas Haller2018-04-041-0/+1
| | | | | | | | | | | | | | | | | | | profile to device NM_CONTROLLED=no has the primary use of marking devices as unmanaged. For that to work, the ifcfg file must contain either a MAC address, an interface-name, or s390-subchannels that match a device. In case the profile doesn't contain such specifiers, the profile is ignored and a warning was logged: <warn> [1522849679.7866] ifcfg-rh: loading "/etc/sysconfig/network-scripts/ifcfg-ens99" fails: NM_CONTROLLED was false but device was not uniquely identified; device will be managed Downgrade this warning to a debug message. It's not unreasonable that a user marks a ifcfg file with NM_CONTROLLED=no, to avoid NetworkManager handling it. Yes, that way, the user did not explicitly mark a device as unmanaged. But NetworkManager will ignore the profile, as the user might resonably desire. No need to warn about that.
* ifcfg-rh: minor cleanup setting out_ignore_error in connection_from_file_full()Thomas Haller2018-04-041-8/+6
| | | | | | - ensure that out_ignore_error is always initialized. Though, in practice all callers already made sure of that. - use NM_SET_OUT() macro.
* systemd: merge branch systemd into masterThomas Haller2018-04-0438-270/+527
|\
| * systemd: update code from upstream (2018-04-04)Thomas Haller2018-04-0434-261/+501
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=c0f9017c1195b9bc3743e8dd000a18d3898b0034 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files :/src/systemd/src/ \ :/shared/nm-utils/siphash24.c \ :/shared/nm-utils/siphash24.h \ :/shared/nm-utils/unaligned.h | \ xargs -d '\n' rm -f nm_copy_sd() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_shared() { mkdir -p "./shared/nm-utils/" cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${1##*/}" } nm_copy_sd "src/basic/alloc-util.c" nm_copy_sd "src/basic/alloc-util.h" nm_copy_sd "src/basic/async.h" nm_copy_sd "src/basic/escape.c" nm_copy_sd "src/basic/escape.h" nm_copy_sd "src/basic/ether-addr-util.c" nm_copy_sd "src/basic/ether-addr-util.h" nm_copy_sd "src/basic/extract-word.c" nm_copy_sd "src/basic/extract-word.h" nm_copy_sd "src/basic/fileio.c" nm_copy_sd "src/basic/fileio.h" nm_copy_sd "src/basic/fd-util.c" nm_copy_sd "src/basic/fd-util.h" nm_copy_sd "src/basic/fs-util.c" nm_copy_sd "src/basic/fs-util.h" nm_copy_sd "src/basic/hash-funcs.c" nm_copy_sd "src/basic/hash-funcs.h" nm_copy_sd "src/basic/hashmap.c" nm_copy_sd "src/basic/hashmap.h" nm_copy_sd "src/basic/hexdecoct.c" nm_copy_sd "src/basic/hexdecoct.h" nm_copy_sd "src/basic/hostname-util.c" nm_copy_sd "src/basic/hostname-util.h" nm_copy_sd "src/basic/in-addr-util.c" nm_copy_sd "src/basic/in-addr-util.h" nm_copy_sd "src/basic/io-util.c" nm_copy_sd "src/basic/io-util.h" nm_copy_sd "src/basic/list.h" nm_copy_sd "src/basic/log.h" nm_copy_sd "src/basic/macro.h" nm_copy_sd "src/basic/mempool.h" nm_copy_sd "src/basic/mempool.c" nm_copy_sd "src/basic/parse-util.c" nm_copy_sd "src/basic/parse-util.h" nm_copy_sd "src/basic/path-util.c" nm_copy_sd "src/basic/path-util.h" nm_copy_sd "src/basic/prioq.h" nm_copy_sd "src/basic/prioq.c" nm_copy_sd "src/basic/process-util.h" nm_copy_sd "src/basic/process-util.c" nm_copy_sd "src/basic/random-util.c" nm_copy_sd "src/basic/random-util.h" nm_copy_sd "src/basic/refcnt.h" nm_copy_sd "src/basic/set.h" nm_copy_sd "src/basic/signal-util.h" nm_copy_sd_shared "src/basic/siphash24.c" nm_copy_sd_shared "src/basic/siphash24.h" nm_copy_sd "src/basic/socket-util.c" nm_copy_sd "src/basic/socket-util.h" nm_copy_sd "src/basic/sparse-endian.h" nm_copy_sd "src/basic/stdio-util.h" nm_copy_sd "src/basic/string-table.c" nm_copy_sd "src/basic/string-table.h" nm_copy_sd "src/basic/string-util.c" nm_copy_sd "src/basic/string-util.h" nm_copy_sd "src/basic/strv.c" nm_copy_sd "src/basic/strv.h" nm_copy_sd "src/basic/time-util.c" nm_copy_sd "src/basic/time-util.h" nm_copy_sd "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/unaligned.h" nm_copy_sd "src/basic/utf8.c" nm_copy_sd "src/basic/utf8.h" nm_copy_sd "src/basic/util.c" nm_copy_sd "src/basic/util.h" nm_copy_sd "src/libsystemd-network/arp-util.c" nm_copy_sd "src/libsystemd-network/arp-util.h" nm_copy_sd "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-network.c" nm_copy_sd "src/libsystemd-network/dhcp6-option.c" nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd "src/libsystemd-network/dhcp-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-network.c" nm_copy_sd "src/libsystemd-network/dhcp-option.c" nm_copy_sd "src/libsystemd-network/dhcp-packet.c" nm_copy_sd "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd "src/libsystemd-network/lldp-internal.h" nm_copy_sd "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd "src/libsystemd-network/lldp-network.c" nm_copy_sd "src/libsystemd-network/lldp-network.h" nm_copy_sd "src/libsystemd-network/network-internal.c" nm_copy_sd "src/libsystemd-network/network-internal.h" nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd "src/libsystemd-network/sd-lldp.c" nm_copy_sd "src/libsystemd/sd-event/sd-event.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd "src/shared/dns-domain.c" nm_copy_sd "src/shared/dns-domain.h" nm_copy_sd "src/systemd/_sd-common.h" nm_copy_sd "src/systemd/sd-dhcp6-client.h" nm_copy_sd "src/systemd/sd-dhcp6-lease.h" nm_copy_sd "src/systemd/sd-dhcp-client.h" nm_copy_sd "src/systemd/sd-dhcp-lease.h" nm_copy_sd "src/systemd/sd-event.h" nm_copy_sd "src/systemd/sd-ndisc.h" nm_copy_sd "src/systemd/sd-id128.h" nm_copy_sd "src/systemd/sd-ipv4acd.h" nm_copy_sd "src/systemd/sd-ipv4ll.h" nm_copy_sd "src/systemd/sd-lldp.h"
* | dns: fix logging path name in update_resolv_conf()Thomas Haller2018-04-041-1/+1
| |
* | core: fix infinite loop in evaluating global dns configurationBeniamino Galvani2018-04-041-5/+5
| | | | | | | | Fixes: cd48bc74b69794a1f60c2f08cc503f8ca43322ae
* | core: merge branch 'th/ipv6-ll-reapply-rh1552069-pt2'Thomas Haller2018-04-046-54/+156
|\ \ | | | | | | | | | https://github.com/NetworkManager/NetworkManager/pull/80
| * | platform: adding onlink gateway route for manual addressesThomas Haller2018-04-044-18/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel does not all allow to configure a route via a gateway, if the gateway is not directly reachable. For non-manually added routes (e.g. from DHCP), we ignore them as a server configuration errors. For manually added routes, we try to work around them. Note that if the user adds a manual route that references a gateway, maybe he should be required to also add a matching onlink route for the gateway (or an address that results in a device-route), otherwise the configuration could be considered invalid. That was however not done historically, and also, it seems a rather unhelpful behavior. NetworkManage should just make it work, not not assume anything is wrong with the configuration. Similarly, for IPv4, the user could configure the route as onlink, however, that still requires extra configuration of which the user might not be aware. This would apply for example, when a connection has method=auto, and would obtain the routes automatically. It seems sensible to allow the user to add a route via the gateway, if he ~knows~ that this particular network will provide such a configuration via DHCP. In the past however, we tried not to automatically add a device route, but instead see whether we will get a suitable route via DHCP. If we wouldn't get such a route, we would however fail the connection. However, this is really very hard to get right. We call ip_config_merge_and_apply() possibly before receiving automatic IP configuration (commit 7070d17cedd09d07f12ce977dd1e16cecf8d4b45, "device: reset @con_ip6_config on failure before RA"). In this case, we could not yet configure the route. Instead, we also cannot fail (yet), because we should wait whether we will receive a route that makes this configuration feasable. That is hard to get right. How long should we wait? If we get a DHCP lease and still cannot add the route, should we fail the IP configuration or wait longer for another lease? Worse, if we decide to fail the IP configuration, it might not fail the entire activation. Instead, we would only mark the current address family as failed. If we later get a DHCP lease, should we retry to add the route again? -- probably yes. If we still fail, we would need to keep the IP configuration in failed state, regardless that DHCP succeeded. Part of the problem is, that we are bad at tracking the failed state per IP method. So, if manual configuration fails but DHCP succeeds, we get the state wrong. That should be fixed separately, but it just shows how hard it is to have this route that we currently cannot add, and wanting to wait for something that might never come, but still fail at some point. Instead, if we cannot add a route due to a missing onlink gateway, just retry and add the /32 or /128 direct route ourself. Note that for IPv6 routes that have a "src" address which is still TENTATIVE, we also cannot currently add the route and retry later. However, that is fundamentally different, because: - the configuration here is correct, it's only that the address didn't yet pass IPv6 DAD and kernel is being unhelpful (rh#1457196). - we only have to wait a few seconds for DAD to complete or fail. So, it's easy to implement this sensibly.
| * | device: add IPv6 link local address via merge-and-applyThomas Haller2018-04-041-36/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device must not directly add addresses or routes. Instead, it must track the addresses/routes it wants to add in the NMIP6Config. Otherwise, during reapply, the information is lost and the next sync will remove them. Fixes-test: @ipv6_preserve_cached_routes
| * | platform: add NM_IP_CONFIG_SOURCE_IP6LL source typeThomas Haller2018-04-042-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | We already have IP4LL and maybe should re-use that also for IPv6. However, when adding the prefix route for IPv6 link local addresses, we want to add it with protocol "kernel", unlike "user" for IPv4. There is no strong reason for this. I don't think the protocol matters much. But up to now kernel automatically adds this prefix route, so as we are going to change that and let NetworkManager add it, keep the protocol at "kernel".
* | gitignore: ignore *.pyc filesThomas Haller2018-04-041-0/+1
| |
* | Revert "core: merge branch 'bg/restart-assume-rh1551958'"Thomas Haller2018-04-044-23/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cc1920d71470042c4e0837848da9183526b663d0, reversing changes made to eb8257dea5802a004af9cccacb30af98440e2172. This breaks restart, at least for Wi-Fi devices: #0 0x00007ffff5ee8771 in _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:554 #1 0x00007ffff5ee9a5b in g_logv (log_domain=0x7ffff671a738 "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd720) at gmessages.c:1362 #2 0x00007ffff5ee9baf in g_log (log_domain=log_domain@entry=0x7ffff671a738 "GLib-GIO", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff5f347ea "%s: assertion '%s' failed") at gmessages.c:1403 #3 0x00007ffff5eea0f9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff671a738 "GLib-GIO", pretty_function=pretty_function@entry=0x7ffff673fc10 <__func__.25628> "g_dbus_proxy_call_internal", expression=expression@entry=0x7ffff673fb1c "G_IS_DBUS_PROXY (proxy)") at gmessages.c:2702 #4 0x00007ffff66cdc5f in g_dbus_proxy_call_internal (proxy=0x0, method_name=method_name@entry=0x555555810510 "Scan", parameters=0x555555c7a530, flags=flags@entry=G_DBUS_CALL_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, fd_list=fd_list@entry=0x0, cancellable=0x0, callback=0x55555574cb96 <scan_request_cb>, user_data=0x555555ac2220) at gdbusproxy.c:2664 #5 0x00007ffff66cf686 in g_dbus_proxy_call (proxy=<optimized out>, method_name=method_name@entry=0x555555810510 "Scan", parameters=<optimized out>, flags=flags@entry=G_DBUS_CALL_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, cancellable=cancellable@entry=0x0, callback=0x55555574cb96 <scan_request_cb>, user_data=0x555555ac2220) at gdbusproxy.c:2970 #6 0x000055555574e026 in nm_supplicant_interface_request_scan (self=0x555555ac2220 [NMSupplicantInterface], ssids=ssids@entry=0x0) at src/supplicant/nm-supplicant-interface.c:1821 #7 0x00007fffe1038276 in request_wireless_scan (self=self@entry=0x555555c6ee60 [NMDeviceWifi], periodic=periodic@entry=0, force_if_scanning=force_if_scanning@entry=0, ssids=<optimized out>, ssids@entry=0x0) at src/devices/wifi/nm-device-wifi.c:1347 #8 0x00007fffe1039011 in device_state_changed (device=0x555555c6ee60 [NMDeviceWifi], new_state=NM_DEVICE_STATE_DISCONNECTED, old_state=<optimized out>, reason=<optimized out>) at src/devices/wifi/nm-device-wifi.c:2998 #9 0x00007ffff432ed1e in ffi_call_unix64 () at ../src/x86/unix64.S:76 #10 0x00007ffff432e68f in ffi_call (cif=cif@entry=0x7fffffffdc70, fn=fn@entry=0x7fffe1038e1e <device_state_changed>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffffffdb60) at ../src/x86/ffi64.c:525 #15 0x00007ffff63db66f in <emit signal ??? on instance 0x555555c6ee60 [NMDeviceWifi]> (instance=instance@entry=0x555555c6ee60, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447 #11 0x00007ffff63bff39 in g_cclosure_marshal_generic (closure=0x555555c22ea0, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490 #12 0x00007ffff63bf73d in g_closure_invoke (closure=0x555555c22ea0, return_value=0x0, n_param_values=4, param_values=0x7fffffffdea0, invocation_hint=0x7fffffffde20) at gclosure.c:804 #13 0x00007ffff63d1f30 in signal_emit_unlocked_R (node=node@entry=0x555555c22750, detail=detail@entry=0, instance=instance@entry=0x555555c6ee60, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffdea0) at gsignal.c:3673 #14 0x00007ffff63dad05 in g_signal_emit_valist (instance=0x555555c6ee60, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffe0b0) at gsignal.c:3391 #16 0x00005555556f0f18 in _set_state_full (self=self@entry=0x555555c6ee60 [NMDeviceWifi], state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=reason@entry=NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED, quitting=quitting@entry=0) at src/devices/nm-device.c:13268 #17 0x00005555556f1774 in nm_device_state_changed (self=self@entry=0x555555c6ee60 [NMDeviceWifi], state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=reason@entry=NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) at src/devices/nm-device.c:13435 #18 0x00005555555bcf95 in recheck_assume_connection (self=self@entry=0x555555b09140 [NMManager], device=device@entry=0x555555c6ee60 [NMDeviceWifi]) at src/nm-manager.c:2297 #19 0x00005555555bd53e in _device_realize_finish (self=self@entry=0x555555b09140 [NMManager], device=device@entry=0x555555c6ee60 [NMDeviceWifi], plink=plink@entry=0x555555ae43d8) at src/nm-manager.c:2473 #20 0x00005555555c01d0 in platform_link_added (self=self@entry=0x555555b09140 [NMManager], ifindex=<optimized out>, plink=plink@entry=0x555555ae43d8, guess_assume=<optimized out>, dev_state=<optimized out>) at src/nm-manager.c:2789 #21 0x00005555555c0cec in platform_query_devices (self=self@entry=0x555555b09140 [NMManager]) at src/nm-manager.c:2901 #22 0x00005555555c439e in nm_manager_start (self=0x555555b09140 [NMManager], error=<optimized out>) at src/nm-manager.c:5632 #23 0x000055555558498e in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:413
* | checkpoint: merge branch 'th/checkpoint'Thomas Haller2018-04-0423-511/+1013
|\ \ | | | | | | | | | https://github.com/NetworkManager/NetworkManager/pull/83
| * | checkpoint/trivial: add fixme commentsThomas Haller2018-04-042-0/+6
| | |
| * | libnm: rework checkpoint APIThomas Haller2018-04-046-130/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libnm API fir checkpoints was only introduced with 1.11. It is not yet stable, so there is still time to adjust it. Note that this changes API/ABI of the development branch. Changes: - we only add async variants of the checkpoint functions. I believe that synchronous D-Bus methods are fundamentally flawed, because they mess up the ordering of events. Rename the async functions by removing the "_async" suffix. This matches glib style, for which the async form is also not specially marked. - for function that refere to a particular checkpoint (rollback and destroy), accept the D-Bus path as string, instead of an NMCheckpoint instance. This form is more flexible, because it allows to use the function without having a NMCheckpoint instance at hand. On the other hand, if one has a NMCheckpoint instance, he can trivially obtain the path to make the call.
| * | checkpoint: minor cleanup of device_checkpoint_create()Thomas Haller2018-04-041-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - indent with spaces for wrapped line - drop g_return_val_if_fail(). It really shouldn't happen, and if it does, we can just continue and will hit g_critical() warnings below, when using the variables. - get the NMActRequest instance first, and from there the applied and settings connection. Not the other way around. nm_device_get_settings_connection() and nm_device_get_applied_connection() are just convenience functions to get the fields from act_request.
| * | examples: improve checkpoint.py for python/giThomas Haller2018-04-041-49/+100
| | | | | | | | | | | | | | | | | | | | | | | | - make python2 and python3 compatible - support Checkpoint create flags (requires recent libnm for GI of flags) - support adjust-rollback-timeout command - print elapsed time in show output
| * | examples: add python utils for examplesThomas Haller2018-04-042-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need common operations from the python scripts. For example, to print the boot-time. Move such utils to a separate nmex.py file ("ex" for example). This file should contain helper functions that are pure python (or, if the have requirements, load them only on demand, so that examples that need those have additional dependencies). It should also be simple to extract individual helpers from nmex, so that the user can take an example, merge parts of nmex.py in, and modify it to his needs.
| * | checkpoint: allow resetting the rollback timeout via D-BusThomas Haller2018-04-0412-4/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to adjust the timeout of an existing checkpoint. The main usecase of checkpoints, is to have a fail-safe when configuring the network remotely. By allowing to reset the timeout, the user can perform a series of actions, and keep bumping the timeout. That way, the entire series is still guarded by the same checkpoint, but the user can start with short timeout, and re-adjust the timeout as he goes along. The libnm API only implements the async form (at least for now). Sync methods are fundamentally wrong with D-Bus, and it's probably not needed. Also, follow glib convenction, where the async form doesn't have the _async name suffix. Also, accept a D-Bus path as argument, not a NMCheckpoint instance. The libnm API should not be more restricted than the underlying D-Bus API. It would be cumbersome to require the user to lookup the NMCheckpoint instance first, especially since libnm doesn't provide an efficient or convenient lookup-by-path method. On the other hand, retrieving the path from a NMCheckpoint instance is always possible.
| * | checkpoint: generate GIR information for NMCheckpointCreateFlagsThomas Haller2018-04-043-2/+4
| | | | | | | | | | | | | | | | | | | | | Note that this changes API for checkpoint_create_async() in Python via GIR. Previously it would require an integer argument, now a flags argument. But this API is still unstable, it will be introduced with 1.12.
| * | checkpoint: refactor setting error for lookup checkpoint failureThomas Haller2018-04-042-15/+11
| | | | | | | | | | | | | | | This changes the error reason in nm_checkpoint_manager_rollback() from NM_MANAGER_ERROR_FAILED to NM_MANAGER_ERROR_INVALID_ARGUMENTS.
| * | checkpoint: allow overlapping checkpointsThomas Haller2018-04-044-30/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new flag NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING that allows the creation of overlapping checkpoints. Before, and by default, checkpoints that reference a same device conflict, and creating such a checkpoint failed. Now, allow this. But during rollback automatically destroy all overlapping checkpoints that were created after the checkpoint that is about to rollback. With this, you can create a series of checkpoints, and rollback them individually. With the restriction, that if you once rolled back to an older checkpoint, you no longer can roll"forward" to a younger one. What this implies and what is new here, is that the checkpoint might be automatically destroyed by NetworkManager before the timeout expires. When the user later would try to manually destroy/rollback such a checkpoint, it would fail because the checkpoint no longer exists.
| * | checkpoint: don't let nm_checkpoint_new() failThomas Haller2018-04-043-14/+12
| | | | | | | | | | | | | | | | | | | | | We already do error checking in nm_checkpoint_manager_create(). No need to split it in two places. Let all error conditions be handled by nm_checkpoint_manager_create() first, and then once we decide all is good, nm_checkpoint_new() can no longer fail.
| * | checkpoint: let each checkpoint schedule its own timeoutThomas Haller2018-04-043-66/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of scheduling one timeout only, let each checkpoint instance individually schedule a timeout. This has some overhead, but glib is supposed to make scheduling many timers efficient. Otherwise, glib should be fixed. This simplifies in my opinion the code, because it's up to each checkpoint to maintain its own timeout. Later we will also add a AdjustRollbackTimeout operation, which allow to reschedule the timeout. It also seems slightly simpler, if scheduling of the timeout is done by the NMCheckpoint instance itself.
| * | checkpoint: simplify device_checkpoint_create() to never failThomas Haller2018-04-041-11/+8
| | | | | | | | | | | | It never failed already. Don't pretend it could.
| * | checkpoint: minor cleanup rolling back checkpointsThomas Haller2018-04-041-7/+14
| | |
| * | checkpoint: don't explicitly track checkpoints in a GHashTableThomas Haller2018-04-043-72/+76
| | | | | | | | | | | | | | | We already have a GHashTable for exported objects. We can use that if we want to look up by path efficiently.
| * | checkpoint: refactor nm_checkpoint_manager_create() to simplify creating ↵Thomas Haller2018-04-041-26/+18
| | | | | | | | | | | | | | | | | | | | | | | | device list If no device paths are given, we can take the devices directly. We don't need to first create a list of paths, and then look them up by path again to add them to the list.
| * | checkpoint: skip unrealized devices in nm_checkpoint_manager_create()Thomas Haller2018-04-041-0/+5
| | | | | | | | | | | | We already do it for the case where no paths are provided.
| * | checkpoint/trivial: rename local variable @checkpoint_pathThomas Haller2018-04-042-19/+19
| | | | | | | | | | | | | | | path is long enough and (in this context) it consistently references the checkpoint "path".
| * | checkpoint/trivial: rename nm_checkpoint_manager_unref() to ↵Thomas Haller2018-04-043-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_checkpoint_manager_free() NMCheckpointManager was added and is not ref-countable, because it is not needed. I still often like for such objects (that are not ref-countable), that their destroy function is called "unref". Both for consistency, and also if we would later add ref-counting to the object. However, NMCheckpointManager keeps a pointer to NMManager. So, when NMManager gets destroyed, it *MUST* destroy the NMCheckpointManager. It cannot accept that the checkpoint manager outlives NMManager, but the "unref" name suggests that somebody else might have still a reference to this object keeping it alive. That is not the case. Rename so that this is clear. I would name it nm_checkpoint_manager_destroy(), but "destroy" already has a meaning for NMCheckpoint instances, so use "free".
| * | checkpoint: embed CList in NMCheckpoint instanceThomas Haller2018-04-044-48/+51
| | | | | | | | | | | | | | | | | | | | | | | | We don't need an external CheckpointItem, just to wrap the CList instance. Embed it directly in NMCheckpoint. Sure, that exposes the checkpoints_lst field in the (internal) header file, hiding the private member less.
| * | libnm: fix crash creating checkpoint during find_checkpoint_info()Thomas Haller2018-04-041-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the D-Bus signals in server are reordered, creating a checkpoint in libnm crashes: $ examples/python/gi/checkpoint.py create 4 #0 0x00007ffff6d011ee in __strcmp_sse2_unaligned () at /lib64/libc.so.6 #1 0x00007fffeb611c90 in find_checkpoint_info (manager=manager@entry=0x5555559e5110 [NMManager], path=0x7fffdc0092f0 "/org/freedesktop/NetworkManager/Checkpoint/6") at libnm/nm-manager.c:153 #2 0x00007fffeb611d8f in checkpoint_added (manager=0x5555559e5110 [NMManager], checkpoint=checkpoint@entry=0x555555a122d0 [NMCheckpoint]) at libnm/nm-manager.c:1194 #3 0x00007fffef7db929 in g_cclosure_marshal_VOID__OBJECTv (closure=0x5555559e4b30, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x5555559e2fc0) at gmarshal.c:2102 #4 0x00007fffef7d8976 in _g_closure_invoke_va (closure=0x5555559e4b30, return_value=0x0, instance=0x5555559e5110, args=0x7fffffffc1c8, n_params=1, param_types=0x5555559e2fc0) at gclosure.c:867 #5 0x00007fffef7f3ff4 in g_signal_emit_valist (instance=instance@entry=0x5555559e5110, signal_id=signal_id@entry=97, detail=0, var_args=var_args@entry=0x7fffffffc1c8) at gsignal.c:3300 #6 0x00007fffef7f4b48 in g_signal_emit_by_name (instance=instance@entry=0x5555559e5110, detailed_signal=detailed_signal@entry=0x7fffffffc310 "checkpoint-added") at gsignal.c:3487 #7 0x00007fffeb6156d1 in deferred_notify_cb (data=0x5555559e5110) at libnm/nm-object.c:219 #8 0x00007fffeb615ae7 in object_property_maybe_complete (self=0x5555559e5110 [NMManager]) at libnm/nm-object.c:555 #9 0x00007fffeb615e5d in object_created (obj=<optimized out>, path=<optimized out>, user_data=<optimized out>) at libnm/nm-object.c:576 #10 0x00007fffeb61648b in handle_object_array_property (pi=<optimized out>, value=0x7fffdc075070, property_name=0x7fffeb67f117 "checkpoints", self=0x5555559e5110 [NMManager]) at libnm/nm-object.c:671 #11 0x00007fffeb61648b in handle_property_changed (self=self@entry=0x5555559e5110 [NMManager], dbus_name=<optimized out>, value=<optimized out>) at libnm/nm-object.c:740 #12 0x00007fffeb6166e9 in properties_changed (proxy=<optimized out>, changed_properties=<optimized out>, invalidated_properties=<optimized out>, user_data=0x5555559e5110) at libnm/nm-object.c:772 ... That is, because NetworkManager now first emits signals that the checkpoint object was created, before answering the D-Bus request. That makes more sense, but leads to this crash. The ugliness of how libnm handles object visibility is considerable. libnm hides objects until they are fully initialized. So, when the async create-checkpoint operation returns, the object might not yet be ready to be exposed. We need to delay the result. It would be better if the API would simply return the created path.
| * | libnm: minor cleanup of nm_manager_get_device_by_path()Thomas Haller2018-04-041-5/+3
| | |
| * | device/trival: rename NMIwdManagerPrivate.nm_manager field to "manager"Thomas Haller2018-04-041-9/+9
| | | | | | | | | | | | | | | | | | Similar cases of such a field are named "manager". Also, internal names shall not have an "nm" prefix, contrary to names in a header file, which shall have such a prefix.
| * | core: add macro for iterating CList of devices of NMManagerThomas Haller2018-04-046-33/+36
| | | | | | | | | | | | | | | | | | I find it slightly nicer and explict. Also, the list elements are strictly speaking private, we should better not explicitly use them outside of NMManager/NMDevice. The macro hides this.
| * | core: drop unused nm_dbus_utils_g_value_set_object_path_array() functionThomas Haller2018-04-042-32/+0
| | |
| * | checkpoint: rework getting NM_CHECKPOINT_DEVICES propertyThomas Haller2018-04-041-7/+3
| | |
| * | core: add nm_dbus_utils_g_value_set_object_path_from_hash() helperThomas Haller2018-04-042-1/+35
|/ /
* | core: merge branch 'bg/restart-assume-rh1551958'Beniamino Galvani2018-04-044-70/+23
|\ \ | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1551958
| * | core: remove @indicated argument of nm_utils_match_connection()Beniamino Galvani2018-04-044-26/+2
| | | | | | | | | | | | It is not needed anymore.
| * | manager: relax checks for assuming connections after restartBeniamino Galvani2018-04-041-44/+21
|/ / | | | | | | | | | | | | | | | | Instead of generating a connection and checking whether it is compatible with the connection indicated in the state file, just pick the indicated connection after a basic check of compatibility with the device. https://bugzilla.redhat.com/show_bug.cgi?id=1551958
* | core: properly initialize stable dhcp client-idBeniamino Galvani2018-04-011-1/+1
| | | | | | | | Fixes: 62a78639797244ef49f439ba2d8bd3332d31585b
* | platform: move genl_ctrl_resolve to nm-netlink.cJavier Arteaga2018-03-303-96/+88
| | | | | | | | | | | | | | Move genl_ctrl_resolve out of the wifi code so it can be reused by other interfaces based on genetlink. https://mail.gnome.org/archives/networkmanager-list/2018-March/msg00044.html
* | po: update Czech translationAsciiWolf2018-03-301-47/+36
| | | | | | | | https://github.com/NetworkManager/NetworkManager/pull/84
* | core: drop obsolete typedef for NMExportedObjectThomas Haller2018-03-301-1/+0
| | | | | | | | It doesn't exist anymore.