summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * device/trivial: rename nm_device_get_ip_route_metric() to ↵Thomas Haller2017-10-065-25/+25
| | | | | | | | | | | | nm_device_get_route_metric() Brevity!
| * device: remove wrappers for nm_device_get_ip_route_metric()Thomas Haller2017-10-064-33/+21
| |
| * wwan: replace utils function ip4_string_to_num() with ↵Thomas Haller2017-10-062-40/+14
| | | | | | | | | | | | | | | | | | | | | | nm_utils_parse_inaddr_bin() One might already question the existance of nm_utils_parse_inaddr_bin(), because it only wraps inet_pton(), which by itself isn't terrible API. The reason nm_utils_parse_inaddr_bin() exists, is to mirror to nm_utils_parse_inaddr() function, which has additional functionality on top of inet_pton(). But we shouldn't have more then one wrapper for inet_pton().
| * shared: guarantee output argument of nm_utils_parse_inaddr_bin() is only set ↵Thomas Haller2017-10-061-1/+18
| | | | | | | | | | | | | | | | on success The documentation of inet_pton() is not clear about what happens when parsing fails. Guarantee that the output is only modified on success.
| * shared: pass addr_family as first argument to nm_utils_parse_inaddr*()Thomas Haller2017-10-065-69/+69
| | | | | | | | | | | | | | The addr_family should be the first argument. It mirrors inet_pton() and is just nicer. Also, rename the argument from "family" to "addr_family".
| * wwan: add FIXME comment about broken ofono supportThomas Haller2017-10-061-0/+3
| |
| * wwan: make idle action for stage3-ip-config cancellableThomas Haller2017-10-061-6/+17
| |
| * wwan: use logging macro in nm-modem.cThomas Haller2017-10-061-60/+86
| | | | | | | | | | | | | | | | | | For some logging lines this changes the domain from LOGD_PPP or LOGD_MB|LOGD_IP4 to LOGD_MB. Also, it changes the format of the prefix, and adds a prefix for some logging lines that didn't have one previously.
| * shared: add nm_strquote() utilThomas Haller2017-10-063-0/+157
|/ | | | | | | | | We already have nm_strquote_a(). That is useful, but uses alloca(), hence it is ill suited to be called from a macro, inside a loop, or from a function that should be inlined. Instead, add nm_strquote() that has the same purpose but writes to a provided string buffer.
* core: avoid compiler warnings related to cleanup attributeThomas Haller2017-10-052-2/+2
| | | | | | | | | gcc doesn't consider variables with cleanup attribute as unused. clang does, and warns about them. In one case, clang is right, in the other one the warning is bogus. Fix both.
* device: fix handling NM_UNMANAGED_USER_CONF in _get_managed_by_flags()Thomas Haller2017-10-051-2/+2
| | | | | | | | | | Found by clang warning: src/devices/nm-device.c:11370:14: error: use of logical '||' with constant operand [-Werror,-Wconstant-logical-operand] || NM_UNMANAGED_USER_UDEV ^ ~~~~~~~~~~~~~~~~~~~~~~ Fixes: 5778bc6a34f2291d68247695119f2170bc3bf8b3
* core: merge branch 'th/activation-state-flags-rh1454883'Thomas Haller2017-10-0512-152/+394
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1454883
| * core: add NMActivationStateFlags "master-has-slaves"Thomas Haller2017-10-053-0/+13
| |
| * core: add NMActivationStateFlags "layer2-ready", "ip4-ready", and "ip6-ready"Thomas Haller2017-10-053-0/+42
| |
| * core: add NMActivationStateFlags "is-master" and "is-slave"Thomas Haller2017-10-052-0/+26
| |
| * libnm: add NMActivationStateFlagsThomas Haller2017-10-057-0/+122
| | | | | | | | | | | | No flags yet implemented. https://bugzilla.redhat.com/show_bug.cgi?id=1454883
| * core: refactor setting applied-connection in NMActiveConnectionThomas Haller2017-10-051-7/+37
| | | | | | | | Introduce a set-function, will be used later.
| * shared: move utils NM_UTILS_ENUM2STR*, NM_UTILS_FLAGS2STR*, and ↵Thomas Haller2017-10-054-147/+151
| | | | | | | | | | | | | | | | nm_utils_to_string_buffer_init() These are just simple utility functions, not tied to NetworkManager core. Move them to shared/nm-utils, so that they may be reused otherwise.
| * core/utils: extend nm_utils_flags2str() for multi-value flags and name for zeroThomas Haller2017-10-051-3/+9
| | | | | | | | | | | | | | | | | | | | Allow passing a pretty name for the zero flag 0, like "none". Also, don't require flags to be power-of-two. Instead, allow names for multiple flags. For example an "all" name. By specifying multi-value flags first, their nick will be supersede the more specific flags. Probably it doesn't make sense in usual cases, but nm_utils_flags2str() should prevent such use.
| * core: minor cleanup of _NMLOG() macro in "src/nm-active-connection.c"Thomas Haller2017-10-051-4/+3
|/
* device: fix frozen notify signals on unrealize error pathBeniamino Galvani2017-10-041-1/+1
| | | | | | | | | If unrealize() failed we returned without thawing notify signals. Fix this by moving g_object_freeze_notify() after the unrealization/deletion but before the properties are reset in unrealize_notify(). Fixes: a93807c288743f499362f7edfe0674020762811c
* core: cleanup autoconnect retry handling (fix settings-docs.c)Thomas Haller2017-10-041-1/+1
| | | | Fixes: cfb14ce17e77916d8998d444a05cdea726723240
* core: cleanup autoconnect retry handlingThomas Haller2017-10-046-12/+19
| | | | | | | | - clearify in the manual page that setting retry to 1 means to try once, without retry. - log the initially set retry value in nm_settings_connection_get_autoconnect_retries(). - use nm_settings_connection_get_autoconnect_retries() in nm_settings_connection_can_autoconnect().
* dhcp: cleanup handling method-call in DHCP listenerThomas Haller2017-10-041-29/+32
| | | | | | Split out a separate function _method_call_handle(). That way we can get rid of the "goto out" and use cleanup attribute to manage resources inside _method_call_handle().
* libnm,keyfile: merge branch 'th/libnm-keyfile-route-metric'Thomas Haller2017-10-043-45/+57
|\
| * keyfile: fix reading/writing route metric zeroThomas Haller2017-10-043-14/+19
| | | | | | | | | | | | | | Zero is a valid route metric and distinct from -1, which means unspecified. Fix reader and writer. Fixes: e374923bbe4a9f608644756f749b9bae9aa5f349
| * keyfile: cleanup error argument for read_field()Thomas Haller2017-10-041-25/+33
| | | | | | | | | | | | | | | | | | | | | | Rename @error to @out_err_str, because @error is usually used for GError output arguments. Also, make the string variables "const char *". Use nm_assert() in read_field(), because it is a static function with only four call sites. It's easily verified that the assertion holds, so no need for a run-time check in production builds.
| * keyfile: minor cleanup in get_one_int() to use _nm_utils_ascii_str_to_int64()Thomas Haller2017-10-041-6/+5
|/
* contrib/scripts: fix coloring for platform messages in NM-log for old logsThomas Haller2017-10-031-1/+1
| | | | | | | | Older logfiles contain platform: route: adding or updating IPv4 route: 10.1.0 Hightlight that too.
* libnm: update property in the manager after connectivity checkBeniamino Galvani2017-10-031-3/+17
| | | | | | | | | | | | | | Currently, after a client performs a connectivity check it cannot access the up-to-date value of the manager.connectivity property right away, but it must wait that the queued PropertiesChanged signal is processed, which is cumbersome. Arguably, clients already receive the new connectivity value as the result of the connectivity check call, so they don't have to read it from the object; however it would be better if the right value of the object property was available immediately as well. https://bugzilla.gnome.org/show_bug.cgi?id=784629
* core: cleanup handling addr_family in NMDeviceThomas Haller2017-10-022-51/+71
| | | | | | | | - use nm_utils_addr_family_to_char(). It asserts that the input argument is either AF_INET or AF_INET6. - rename variable @family to @addr_family for consistency. - when logging addr_family for activation-stage, use v4 or v6 instead of numeric AF_INET/AF_INET6.
* shared: add nm_utils_addr_family_to_char()Thomas Haller2017-10-021-0/+15
|
* core: minor cleanup in dhcp_schedule_restart()Thomas Haller2017-10-021-12/+14
| | | | | | | Move creating the logging output inside the logging macro, so it is evaluated lazyly. Also, use a stack-allocated buffer. Drop the redundant @inet4 variable.
* core: merge branch 'th/manager-cleanup'Thomas Haller2017-09-292-57/+92
|\
| * device: fix delay startup complete for unrealized devicesThomas Haller2017-09-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since commit 6845b9b80a9fcec9d2c9e7b56a37329f38089f2e ("device: delay startup complete until device is initialized in platform", we also wait for devices that are still initializing platform/UDEV. Obviously, that only applies to realized devices. Otherwise, an unrealized device is going to block startup complete. Fixes: 6845b9b80a9fcec9d2c9e7b56a37329f38089f2e
| * core: keep platform link object alive and don't copy itThomas Haller2017-09-292-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, when we have a platform object, we need to keep it alive, because any subsequent platform operation might invalidate the object. Previously, we achieved that by copying the NMPlatformLink data. For a while now, all platform object are immuable and recounted. We should not copy the instance to a NMPlatformLink object, because then the instance is no longer a full NMPObject. Instead, just take an additional reference. Since the object must be immutable, that is just as safe. But now callees down the stack get a proper NMPObject instance, and might reference it too.
| * manager: refactor lifetime handling for idle callback _platform_link_cb_idle()Thomas Haller2017-09-291-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | We call _platform_link_cb_idle() on idle, so we must take care of the lifetime of NMManager. We don't want to take a reference, so that the manager is not kept alive by platform events. Refactor the previous implementation with weak pointers to use a linked list instead. Let's not have any pending idle actions after the manager instance is destroyed. Instead, properly track and cancel the events.
| * manager: disconnect platform_link_cb() from NMManager in dispose()Thomas Haller2017-09-291-0/+4
| |
| * manager/trivial: rename self variable in NMManager:dispose()Thomas Haller2017-09-291-19/+19
| |
| * manager: don't use platform singleton but keep a private pointerThomas Haller2017-09-291-12/+23
|/ | | | | | | | | | We should reduce uses of singletons in general. Instead, the platform instance should be passed around and kept for as long as it's needed. Especially, as we subscribe platform_link_cb() signal. Currently, we never unsubscribe it (wrongly). Subscribing signals is a strong indication that the target object should keep the source object alive until the signal is unsubscribed.
* core: merge branch 'bg/autoconnect-blocked-rh1310676'Beniamino Galvani2017-09-294-31/+40
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1310676
| * core: rename NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_UNBLOCKED enumBeniamino Galvani2017-09-293-7/+7
| | | | | | | | NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_NONE sounds better.
| * core: unblock failed connections when the master is availableBeniamino Galvani2017-09-291-17/+24
| | | | | | | | | | | | | | | | In case the connection is blocked because it failed, the availability of a master is a good reason to unblock it so that it can be tried again. Fixes: a1ea422aadffa808dda780e005969ecadb8c260e
| * core: make auto-connect-blocked-reason more specificBeniamino Galvani2017-09-294-8/+10
|/ | | | | | | | | Distinguish between connections blocked from autoconnecting by user request and connections blocked because they failed (and would fail again). Later, the reason will be used to unblock failed connection when some conditions change.
* man: clearify plain text secrets in keyfileThomas Haller2017-09-282-6/+13
|
* core: merge branch 'th/device-manage-conf'Thomas Haller2017-09-284-6/+66
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/29
| * device: add configuration option to mark devices as unmanagedThomas Haller2017-09-284-6/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have various ways to mark a device as unmanaged. 1) via udev-rule ENV{NM_UNMANAGED}. This can be overwritten via D-Bus at runtime. 2) via settings plugin. That is NM_CONTROLLED=no for ifcfg-rh and keyfile.unmanaged-devices in NetworkManager.conf. 3) at runtime, via D-Bus. This is persisted in the run state file and persists restarts (but not reboot). This adds another way via NetworkManager.conf file. Note that the existing keyfile.unmanaged-devices (above 2) is also a configuration optin in NetworkManager.conf. However it has various downsides: - it cannot be overwritten at runtime (see commit c210134bd58ea40ee3458aff27ab41958e1f48b4). - you can only explicitly mark a device as unmanaged. That means, you cannot use it to manage a device which is unmanaged due to a udev rule. - the name "keyfile.*" sounds like it's only relevant for the keyfile settings plugin. Nowadays the keyfile plugin is always loaded, so the option applies to NetworkManager in general. https://github.com/NetworkManager/NetworkManager/pull/29
| * man: fix example for device section in NetworkManager.conf's manualThomas Haller2017-09-281-1/+1
|/ | | | | | | | | | | | | | We currently don't support marking a device a managed/unmanaged via the [device] section. Eventually, I think we should, because the existing "keyfile.unmanaged-devices" looks keyfile specific (which it isn't). But more importantly, "keyfile.unmanaged-devices" sets the unmanaged flag NM_UNMANAGED_USER_SETTINGS, which cannot be overruled via D-Bus (see commit c210134bd58ea40ee3458aff27ab41958e1f48b4). A device.managed flag would make sense for a more sensible way to express configuration in NetworkManager.conf, which still can be overwritten via D-Bus. Anyway, it's not yet implemented. Fix the example.
* core: merge branch 'bg/parent-uuid'Beniamino Galvani2017-09-287-208/+77
|\ | | | | | | https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00032.html
| * device: match all UUIDs when no connection is activeBeniamino Galvani2017-09-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_device_match_parent() is called to check whether a device is compatible with a given parent (UUID or interface). Accept any UUID If there is no connection active on the device. Without this, when there is a VLAN/MACVLAN connection with a parent UUID the manager would create the device in system_create_virtual_device(), realize it and then at the next call of system_create_virtual_device() it would notice that the connection is not compatible with the device because of the parent UUID; therefore the manager would try to create again the same device, failing. https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00034.html