summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* dhcp: refactor dhclient_start() to use cleanup attributeThomas Haller2018-05-261-45/+45
|
* dhcp: cache errno in nm_dhcp_client_stop_existing() before using itThomas Haller2018-05-262-6/+10
|
* dhcp: use NMIPConfig type for argument of nm_dhcp_client_set_state()Thomas Haller2018-05-263-14/+13
|
* dhcp: use cleanup attribute in nm_dhcp_client_handle_event()Thomas Haller2018-05-261-22/+19
| | | | and use NMIPConfig type.
* dhcp: minor cleanup initializing name of leasefile for NMDhcpDhclintThomas Haller2018-05-261-17/+11
|
* core: let NM_IS_IP_CONFIG() check for expected addr-familyThomas Haller2018-05-263-8/+14
| | | | Still unused...
* dhcp: fix leaking error in dhclient_start()Thomas Haller2018-05-261-0/+1
| | | | Fixes: 1b1b4bd91c29425c25e8e979cd77b7a67deb9bf5
* core: add and use NM_SHUTDOWN_TIMEOUT_MS as duration that we plan for shutdownThomas Haller2018-05-252-1/+21
| | | | | | | | | | | | | | | | | | | | | | | nm_ppp_manager_stop() wants to ensure that the pppd process is really gone. For that it uses nm_utils_kill_child_async() to first send SIGTERM, and sending SIGKILL after a timeout. Later, we want to fix shutdown of NetworkManager to iterate the mainloop during shutdown, so that such operations are still handled. However, we can only delay shutdown for a certain time. After a timeout (NM_SHUTDOWN_TIMEOUT_MS plus NM_SHUTDOWN_TIMEOUT_MS_GRACE) we really have to give up and terminate. That means, the right amount of time between sending SIGTERM and SIGKILL is exactly NM_SHUTDOWN_TIMEOUT_MS. Hopefully that is of course sufficient in the first place. If not, send SIGKILL afterwards, and give a bit more time (NM_SHUTDOWN_TIMEOUT_MS_GRACE) to reap the child. And if all this time is still not enough, something is really odd and we abort waiting, with a warning in the logfile. Since we don't properly handle shutdown yet, the description above is not really true. But with this patch, we fix it from point of view of NMPPPManager.
* ppp-manager: rework stopping NMPPPManager by merging async/sync methodsThomas Haller2018-05-259-157/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there were two functions nm_ppp_manager_stop_sync() and nm_ppp_manager_stop_async(). However, stop-sync() would still kill the process asynchronously (with a 2 seconds timeout before sending SIGKILL). On the other hand, stop-async() did pretty much the same thing as sync-code, except also using the GAsyncResult. Merge the two functions. Stopping the instance for the most part can be done entirely synchrnous. The only thing that is asynchronous, is to wait for the process to terminate. For that, add a new callback argument to nm_ppp_manager_stop(). This replaces the GAsyncResult pattern. Also, always ensure that NetworkManager runs the mainloop at least as long until the process really terminated. Currently we don't get that right, and during shutdown we just stop iterating the mainloop. However, fix this from point of view of NMPPPManager and register a wait-object, that later will correctly delay shutdown. Also, NMDeviceWwan cared to wait (asynchronously) until pppd really terminated. Keep that functionality. nm_ppp_manager_stop() returns a handle that can be used to cancel the asynchrounous request and invoke the callback right away. However note, that even when cancelling the request, the wait-object that prevents shutdown of NetworkManager is kept around, so that we can be sure to properly clean up.
* ppp-manager/trivial: rename variables holding self pointersThomas Haller2018-05-251-64/+64
| | | | | | We usually structure our code in a (pseudo) object oriented way. It makes sense to call the variable for the target object "self", it is more familiar and usually done.
* ppp-manager: refactor killing pppd process by using _ppp_kill() functionThomas Haller2018-05-251-24/+25
| | | | | | | | | | - add callback arguments to _ppp_kill(). Although most callers don't care, it makes it more obvious that this kills the process asynchronously. - the call to nm_utils_kill_child_async() is complicated, with many arguments. Only call it from one place, and re-use the simpler wrapper function _ppp_kill() everywhere.
* core: add nm_shutdown_register_watchdog() for marking object to wait for ↵Thomas Haller2018-05-252-0/+101
| | | | | | | | | | | | | | | shutdown Eventually we should do a coordinated shutdown when NetworkManager exits. That is a large work, ensuring that all asynchronous actions are cancellable (in time), and that we wait for all pending operations to complete. Add a function nm_shutdown_register_watchdog(), so that objects can register themselves, to block shutdown until they are destroyed. It's not yet used, because actually iterating the mainloop during shutdown can only be done, once the code is prepared to be ready for that. But we already need the function, so that we can refactor individual parts of the code, in preparation of using it in the future.
* active-connection: fix build with clang-6.0Lubomir Rintel2018-05-211-1/+2
| | | | | | | | | | | | | | | | | | | | glib 2.56's g_steal_pointer() won't tolerate a function pointer in place of a gpointer. CC src/src_libNetworkManager_la-nm-active-connection.lo src/nm-active-connection.c:1017:17: error: pointer type mismatch ('NMActiveConnectionAuthResultFunc' (aka 'void (*)(struct _NMActiveConnection *, int, const char *, void *)') and 'gpointer' (aka 'void *')) [-Werror,-Wpointer-type-mismatch] result_func = g_steal_pointer (&priv->auth.result_func); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmem.h:200:6: note: expanded from macro 'g_steal_pointer' (0 ? (*(pp)) : (g_steal_pointer) (pp)) ^ ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. There's just a single spot we use it that way, so it's perhaps better to work around the warning instead of disabling it.
* build/meson: fix building internal systemd libraryThomas Haller2018-05-191-0/+1
| | | | Fixes: d577888d8f73e62866dfa70d4dd14b35373e4e7d
* systemd: merge branch systemd into masterThomas Haller2018-05-1841-193/+853
|\
| * systemd: update code from upstream (2018-05-18)Thomas Haller2018-05-1840-193/+847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=7fbb5dd5e2cc733a83af813b13e859a8172a6046 ( 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/stat-util.c" nm_copy_sd "src/basic/stat-util.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"
* | active-connection: fix harmless typoFrancesco Giudici2018-05-181-1/+1
| |
* | devices/wwan: Stop PPP manager in deactivate_cleanup()Frederic Danis2018-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ModemManager exits, pppd is not killed due to nm_exported_object not unexported (ppp_manager refcount = 2). Call to nm_ppp_manager_stop_sync() allows to correctly clean ppp_manager before calling g_clear_object(), as this is done in nm-device-ethernet.c and nm-device-adsl.c. [thaller@redhat.com: rebase and adjust patch] https://bugzilla.gnome.org/show_bug.cgi?id=796108 https://mail.gnome.org/archives/networkmanager-list/2018-May/msg00015.html
* | core: minor cleanup using helpers NM_IN_STRSET() and nm_utils_strdict_get_keys()Thomas Haller2018-05-162-17/+7
| |
* | dns: sd-resolved: honor dns-priorityBeniamino Galvani2018-05-141-38/+16
| | | | | | | | | | Honor dns-priority by using the preprocessed list of domains provided by the manager.
* | dns: dnsmasq: honor dns-priorityBeniamino Galvani2018-05-141-140/+22
| | | | | | | | | | Honor dns-priority by using the preprocessed list of domains provided by the manager.
* | dns: use dns-priority to provide a preprocessed domain list to pluginsBeniamino Galvani2018-05-144-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do some preprocessing on the DNS configuration sent to plugins: - add the '~' default routing (lookup) domain to IP configurations with the default route or, when there is none, to all non-VPN IP configurations - use the dns-priority to decide which connection to use in case multiple connections have the same domain - consider a negative dns-priority value as a way to 'shadow' all subdomains from other connections - compute reverse DNS domains and add the resulting domain list to NMDnsIPConfigData so that split-DNS plugins can use that directly instead of reimplementing the same logic themselves.
* | core: reject invalid domains from ip configurationsBeniamino Galvani2018-05-145-74/+47
| | | | | | | | Reject domains containing ".." or starting with "."
* | dns: dnsmasq: fix adding multiple domainsBeniamino Galvani2018-05-141-1/+1
| | | | | | | | Fixes: e91f1a7d2a6b8400b6b331d5b72287dcb5164a39
* | all: use the elvis operator wherever possibleLubomir Rintel2018-05-1033-76/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coccinelle: @@ expression a, b; @@ -a ? a : b +a ?: b Applied with: spatch --sp-file ternary.cocci --in-place --smpl-spacing --dir . With some manual adjustments on spots that Cocci didn't catch for reasons unknown. Thanks to the marvelous effort of the GNU compiler developer we can now spare a couple of bits that could be used for more important things, like this commit message. Standards commitees yet have to catch up.
* | all: add and utilize nm_utils_is_separator()Lubomir Rintel2018-05-101-1/+1
| | | | | | | | | | | | | | | | | | It is meant to be rather similar in nature to isblank() or g_ascii_isspace(). Sadly, isblank() is locale dependent while g_ascii_isspace() also considers vertical whitespace as a space. That's no good for configuration files that are strucutured into lines, which happens to be a pretty common case.
* | device: start IP configuration when master carrier goes upBeniamino Galvani2018-05-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the master has no carrier in act_stage3_ip6_config_start(), we set IP state WAIT and wait until carrier goes up before starting IP configuration. However, in carrier_changed() if the device state is ACTIVATED we only call nm_device_update_dynamic_ip_setup(), which just restarts DHCP if it was already running. Let's also ensure that we start IP configuration if the IP state is WAIT. Fixes: b0f6baad90a3d8b571a56cc255ad49d9fa26d874 https://bugzilla.redhat.com/show_bug.cgi?id=1575944
* | core-utils: don't load modules not ending with ".so"Lubomir Rintel2018-05-091-1/+1
| | | | | | | | This prevents attempts to load garbage from the module directory.
* | meson: distinguish arch specific and arch neutral lib dirLubomir Rintel2018-05-0911-12/+12
| | | | | | | | | | Plugins go to the arch specific place while conf.d/ and VPN/ are in lib/. Use the same naming as is used with autoconf.
* | session-monitor: avoid an assertion failure if there's no session monitorLubomir Rintel2018-05-091-1/+1
| | | | | | | | | | | | The constructor can bail out early, not setting monitor->sd.watch: (NetworkManager:373): GLib-CRITICAL **: 20:35:58.601: g_source_remove: assertion 'tag > 0' failed
* | platform: fix adding direct route to gatewayBeniamino Galvani2018-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Without ifindex, adding the direct route to gateway fails: platform: route-sync: failure to add IPv6 route: fd02::/64 via fd01::1 dev 1635 metric 101 mss 0 rt-src user: No route to host (113); try adding direct route to gateway fd01::1/128 via :: metric 101 mss 0 rt-src user platform: route: append IPv6 route: fd01::1/128 via :: metric 101 mss 0 rt-src user platform-linux: delayed-action: schedule wait-for-nl-response (seq 269, timeout in 0.199999195, response-type 0) platform-linux: delayed-action: handle wait-for-nl-response (any) platform-linux: netlink: recvmsg: new message NLMSG_ERROR, flags 0, seq 269 platform-linux: netlink: recvmsg: error message from kernel: No such device (19) for request 269 Fixes: c9f89cafdf588f443821ccff220283859ab26d1f
* | checkpoint: fix D-Bus operation to destroy checkpointThomas Haller2018-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | When passing "/" to destroy all checkpoints, wrongly no checkpoint was destroyed. When passing a particular path that should be destroyed, wrongly all checkpoints were destroyed. Fixes: 79458a558bdf45a789df3024f84942f85eb15875
* | auth-manager: use the correct function to deallocate a GErrorLubomir Rintel2018-05-021-1/+1
| | | | | | | | This one ruins the party.
* | manager: search all existing active connections during ↵th/manager-activation-cleanupThomas Haller2018-04-301-7/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_manager_get_best_device_for_connection() In nm_manager_get_best_device_for_connection(), not only check whether the first found active-connection has a device. There might be multiple candidates, in which case iterate over them and figure out which one is the most suitable. Also, despite the found @ac has the same settings-connection, it does not mean that the connection is available on the device. Extend the check and only return compatible and ready devices. This can easily happen that the settings-connection was modified in the meantime and no longer is compatible with the device (despite currently being active on the device, but with the previous settings).
* | manager: disconnect all conflicting concurrent active connections in ↵Thomas Haller2018-04-301-5/+18
| | | | | | | | | | | | | | | | | | _internal_activate_device() It is possible, that there are multiple such conflicting connections. Maybe not now, but with connecition cardinality it will soon be. Find and disconnect them all.
* | core: rework nm_device_steal_connection()Thomas Haller2018-04-303-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_device_steal_connection() was a bit misleading. It only had one caller, and what _internal_activate_device() really wants it to deactivate all other active-connections for the same connection. Hence, it already performed a lookup for the active-connection that should be disconnected, only to then lookup the device, and tell it to steal the connection. Note, that if existing_ac happens to be neither the queued nor the currenct active connection, then previously it would have done nothing. It's unclear when that exactly can happen, however, we can avoid that question entirely. Instead of having steal-connection(), have a disconnect-active-connection(). If there is no matching device, it will just set the active-connection's state to DISCONNECTED. Which in turn does nothing, if the state is already DISCONNECTED.
* | core: don't consider deactivating active-connection when checking for ↵Thomas Haller2018-04-301-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | concurrent activations At various places we check whether we have an active-connection already. For example, when activating a new connection in _internal_activate_device(), we might want to "nm_device_steal_connection()" if the same profile is already active. However, the max-state argument was not accurate in several cases. For the purpose of finding concurrent activations, we don't care about active-connections that are already in state DEACTIVATING. Only those that are ACTIVATED or before.
* | manager: minor refactoring of active_connection_find_by_connection()Thomas Haller2018-04-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | active_connection_find_by_connection() (or how it was called previously) is a simpler wrapper around active_connection_find(), which accepts a NMConnection argument, that may or may not be a NMSettingsConnection. It always passed NM_ACTIVE_CONNECTION_STATE_DEACTIVATING as max_state, and I think that one of the two callers don't should do that. A later commit will change that. So, we also want to pass @max_state as argument to active_connection_find_by_connection(). At that point, make active_connection_find_by_connection() identical to active_connection_find(), with the only exception, that it accepts a NMConnection and does automatically do the right thing (either lookup by pointer equality or by uuid).
* | manager: extend helper function to find all matching active-connectionsThomas Haller2018-04-301-25/+61
| | | | | | | | | | | | ... instead of just the first. It's not used yet, and there is no change in behavior.
* | core: only abort conflicting activations for certain activation typesThomas Haller2018-04-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are various places where we do an internal activation (with an internal auth-subject). In several of these places, the ACTIVATION_REASON is USER_REQUEST. I think it is wrong to generally abort all internal activations, except AUTOCONNECT_SLAVES ones. I think, aborting an activation should be opt-in instead of opt-out. To me it seems, we want to abort the activation based on the activation reason. For now, opt-in to EXTERNAL, ASSUME and AUTOCONNECT only. If there are additional cases where we should abort activation, we should add yet another reason and not use USER_REQUEST.
* | core: add activation-reasons for external/assume connectionsThomas Haller2018-04-303-6/+14
| | | | | | | | | | | | | | | | | | Until now, we only really cared about whether a connection was activated with reason NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES or not. Now however, we will care about whether a connection was activated via (genuine) autoconnect by NMPolicy, or external/assume by NMManager. Add a new reason to distinguish between them.
* | settings: avoid lookup in nm_settings_has_connection()Thomas Haller2018-04-301-10/+17
| | | | | | | | | | | | | | | | There is no need to perform a lookup by path. NMSettings is a singleton, it has the connection exactly iff the connection is linked. Also add an assertion to double-check that the results agree with the previous implementation.
* | all: remove consecutive empty linesBeniamino Galvani2018-04-3068-123/+0
| | | | | | | | | | | | | | Normalize coding style by removing consecutive empty lines from C sources and headers. https://github.com/NetworkManager/NetworkManager/pull/108
* | manager: fix assertion in nm_manager_activate_connection()Beniamino Galvani2018-04-301-4/+6
| | | | | | | | | | | | | | | | | | | | nm_manager_activate_connection() should not require a device to be passed in for VPN connections because when the argument is NULL the actual device will be determined by _new_active_connection(). Fixes: 10753c36168a82cd658df8a7da800960fddd78ed https://bugzilla.redhat.com/show_bug.cgi?id=1570545 https://github.com/NetworkManager/NetworkManager/pull/109
* | device/connectivity: refactor concheck_periodic_schedule_do()Thomas Haller2018-04-271-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | Instead of passing the interval for the timeout, let concheck_periodic_schedule_do() figure it out on its own. It only depends on cur-interval and cur-basetime. Additionally, pass now_ns timestamp, because we already made decisions based on this particular timestamp. We don't want to re-evalutate the current time but ensure to use the same timestamp. There is no change in behavior, it just seems nicer this way.
* | device: force a connectivity check when reaching device-state "activated"Thomas Haller2018-04-271-13/+29
| | | | | | | | | | | | | | | | When the device-state changes to "activated", force a connectivity check right away. Something possibly happened that affected connectivity. Also, reduce the interval time down to CONCHECK_P_PROBE_INTERVAL to start probing again.
* | iwd: fix crash updating scan list when comparing new APsThomas Haller2018-04-241-5/+5
| | | | | | | | Fixes: d7b1a911d913a2b6f5b26bcab01965e3a533081d
* | iwd: fix assertion failure when requesting scanAndreas Henriksson2018-04-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if device *is* a NM_DEVICE_IWD, then make sure to not pass that to _nm_device_wifi_request_scan (which asserts on anything else than a NM_DEVICE_WIFI device). The crash can be triggered by enabling wifi.backend=iwd and clicking on the 'select network' item in gnome shell for example. The journal output looks like this: NetworkManager[1861]: invalid cast from 'NMDeviceIwd' to 'NMDeviceWifi' NetworkManager[1861]: ** NetworkManager[1861]: NetworkManager:ERROR:src/devices/wifi/nm-device-wifi.c:1127:_nm_device_wifi_request_scan: assertion failed: ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((_obj)); GType __t = ((nm_device_wifi_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=6/ABRT systemd[1]: NetworkManager.service: Failed with result 'core-dump'. Fixes: 297d4985abcc7b571b8c090ee90622357fc60e16 https://github.com/NetworkManager/NetworkManager/pull/107
* | device: fix nm_device_get_type_description() for veth devicesThomas Haller2018-04-242-2/+17
| | | | | | | | | | | | | | | | Without this, nm_device_get_type_description() would quite likely return "ethernet" for NMDeviceVeth types. This is wrong and was broken recently. Fixes: 07756025745493b1999f7c04b5e826c50b73b42d
* | core/dbus: stop NMDBusManager and reject future method callsThomas Haller2018-04-248-25/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During shutdown, we will need to still iterate the main loop to do a coordinated shutdown. Currently we do not, and we just exit, leaving a lot of objects hanging. If we are going to fix that, we need during shutdown tell NMDBusManager to reject all future operations. Note that property getters and "GetManagerObjects" call is not blocked. It continues to work. Certainly for some operations, we want to allow them to be called even during shutdown. However, these have to opt-in. This also fixes an uglyness, where nm_dbus_manager_start() would get the set-property-handler and the @manager as user-data. However, NMDBusManager will always outlife NMManager, hence, after NMManager is destroyed, the user-data would be a dangling pointer. Currently that is not an issue, because - we always leak NMManager - we don't run the mainloop during shutdown