summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* platform: support creating non-persistant TUN/TAP devicesth/platform-tunThomas Haller2018-04-068-35/+88
| | | | | | | | | | | | | | | | | For completeness, extend the API to support non-persistant device. That requires that nm_platform_link_tun_add() returns the file descriptor. While NetworkManager doesn't create such devices itself, it recognizes the IFLA_TUN_PERSIST / IFF_PERSIST flag. Since ip-tuntap (obviously) cannot create such devices, we cannot add a test for how non-persistent devices look in the platform cache. Well, we could instead add them with ioctl directly, but instead, just extend the platform API to allow for that. Also, use the function from test-lldp.c to (optionally) use nm_platform_link_tun_add() to create the tap device.
* platform/tests: extend nmtstp_wait_for_link*() to never waitThomas Haller2018-04-061-2/+17
| | | | | | | | | | | | Previously, it was not (reliably) possible to use nmtstp_wait_for_link*() to only look into the platform cache, without trying to poll the netlink socket for events. Add this option. Now, if the timeout is specified as zero, we never actually read the netlink socket. Currently, there are no callers who make use of this (by passing a zero timeout). So, this is no change in existing behavior.
* platform/tests: implement nmtstp_assert_wait_for_link() as macroThomas Haller2018-04-062-18/+5
| | | | | | | | Implement nmtstp_assert_wait_for_link() and nmtstp_assert_wait_for_link_until() as macros, based on nmtst_assert_nonnull(). This way, the assertion will report a more helpful file:line location, instead of being somewhere nested inside test-common.c.
* shared/tests: add nmtst_assert_nonnull() macroThomas Haller2018-04-061-0/+8
| | | | | There is g_assert_nonnull(), however that doesn't return the pointer. Returning the pointer can be convenient...
* platform/tests: add tests for TUN/TAP handlingThomas Haller2018-04-063-1/+129
|
* platform: workaround kernel issue for tun device for first RTM_NETLINK eventThomas Haller2018-04-061-0/+14
| | | | | | | | Due to a bug, the current rc-kernel will emit the first netlink notification about tun devices before the device is initialized. Hence, the content of the message is bogus. If the message looks like to be this case, re-request it right away.
* platform: refetch TUN link when no type-specific lnk data was receivedThomas Haller2018-04-061-0/+1
| | | | | | | | | | | | | | | Now that kernel supports providing information about tun/tap devices via netlink, make use of it. Also, enable the hack that: - when we first see a link that has no lnk data, we refetch it on the assumption, that kernel just didn't send it the first time. For old kernels that do not yet support tun properties on netlink, this means that we will always refetch the link once, the first time we see it. I think that is acceptable, and the more correct behavior for newer kernels that do support it.
* platform: enable parsing tun/tap properties from netlinkThomas Haller2018-04-061-4/+0
| | | | | | | Now that the kernel patches are merged to mainline (rc), enable accepting tun/tap link properties from netlink. https://bugzilla.redhat.com/show_bug.cgi?id=1547213
* platform: refactor fetching links in cache_on_change()Thomas Haller2018-04-061-26/+20
| | | | | | | | Rework the code to if-else-if, to not schedule the same DELAYED_ACTION_TYPE_REFRESH_LINK instance multiple times. Note that delayed_action_schedule() already would check that no duplicates are scheduled, but we can avoid that.
* platform: assert in nm_platform_link_tun_add() for unsupported optionsThomas Haller2018-04-061-2/+3
| | | | | | | It doesn't make sense that NetworkManager adds non-persist tun devices, likewise, only the type IFF_TUN or IFF_TAP is supported. Assert that the values are as expected.
* platform: adjust format for nm_platform_lnk_tun_to_string() and print "persist"Thomas Haller2018-04-061-4/+6
| | | | | | | | | | | | | | | | Switch from "pi on|off" to optinally printing "pi" to indicate whether the flag is set. That follows ip-tuntap syntax and is more familiar: $ ip tuntap help Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ] [ mode { tun | tap } ] [ user USER ] [ group GROUP ] [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ] Where: USER := { STRING | NUMBER } GROUP := { STRING | NUMBER } Also, print the "persist" flag.
* platform: fix double whitespace for tun device in ↵Thomas Haller2018-04-061-1/+1
| | | | nm_platform_lnk_tun_to_string()
* nmtst: add nmtst_get_rand_bool() utilThomas Haller2018-04-061-0/+6
|
* tools/run-nm-test.sh: add -d option to set NMTST_DEBUG=dThomas Haller2018-04-061-0/+8
| | | | | For convenience, by passing "-d" to tools/run-nm-test.sh, we set NMTST_DEBUG=d (if $NMTST_DEBUG is unset previously).
* core: fix freeing reg_data in error path of _obj_register()Thomas Haller2018-04-061-1/+1
| | | | Fixes: 640736ff65059bbe29ae7fa273015d849c78092a
* core: merge branch 'th/auth-chain'Thomas Haller2018-04-067-201/+220
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/86
| * auth-chain: optimize tracking of user data for NMAuthChainThomas Haller2018-04-061-18/+25
| | | | | | | | | | | | | | - instead of allocating memory separately for the @tag (key) and ChainData (data), store the tag also inside ChainData. - instead of adding two separate key and value items to GHashTable, use g_hash_table_add(), which is optimized for this case.
| * shared: add nm_pstr_hash() and nm_pstr_equal()Thomas Haller2018-04-062-0/+35
| |
| * auth-chain: don't compare pointers explicitly against NULLThomas Haller2018-04-051-11/+11
| |
| * auth-chain: split handling auth-call in idleThomas Haller2018-04-051-7/+25
| | | | | | | | | | | | | | auth_call_complete() had two callers: once from the idle handler, and once from pk_call_cb(). The conditions are slightly different, split the function in two. For one, this allows to unset the obsolete call_idle_id.
| * auth-chain/trivial: move codeThomas Haller2018-04-051-77/+83
| |
| * auth-chain: drop unused nm_auth_chain_get_data_ulong()Thomas Haller2018-04-052-33/+0
| |
| * auth-chain: use CList for tracking pending authentication requestsThomas Haller2018-04-051-68/+55
| |
| * shared: add nm_c_list_contains_entry() helperThomas Haller2018-04-051-0/+7
| |
| * core: drop unnecessary #if WITH_POLKIT from nm-auth-subject.hThomas Haller2018-04-052-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-051-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-051-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.