summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ifnet: fix error handlingLubomir Rintel2016-04-291-7/+4
| | | | | | CID 76722 (#1 of 1): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this statement: g_set_error(error, nm_setti....
* config: call va_end() in unexpected code path tooLubomir Rintel2016-04-291-7/+5
| | | | | CID 99747 (#1 of 1): Missing varargs init or cleanup (VARARGS) 13. missing_va_end: va_end was not called for ap.
* cli: handle device failure when activatingBeniamino Galvani2016-04-291-1/+8
| | | | | We might receive the update of the device state to FAILED when the active connection is still in ACTIVATING. Handle this case properly.
* build: cleanup include of <config.h>Thomas Haller2016-04-282-2/+3
| | | | | | | | | | | | It is recomended to include <config.h> with angle brackets [1]. Note, that usually we don't include <config.h> directly, except in two places we have to (because there we include conflicting libraries that must be included before "nm-default.h"). In that case, define __CONFIG_H__ which is used as include guard around <config.h> by "nm-default.h". [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Configuration-Headers.html
* wwan/trivial: fix whitespace and indentionThomas Haller2016-04-281-8/+7
|
* libnm/vpn: don't leak editor-plugin if nm_vpn_editor_plugin_load() failsThomas Haller2016-04-281-2/+1
|
* libnm: store NMConnectionPrivate via g_object_set_qdata()Thomas Haller2016-04-281-3/+9
| | | | | | g_object_get_data() and g_object_get_qdata() end up to be identical, except that g_object_get_data() also requires to intern the string on every lookup (which involves a hash lookup and locking).
* manager: embed NMManagerPrivate data directly into NMManager structThomas Haller2016-04-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | For a type to be inheritable, its public struct (NMManager) must be known. As nobody inherits NMManager, we can make it private. As the struct is private anyway, we can also reuse it for the private data directly, instead of registering NMManagerPrivate in the manager class. There are advantages and disadvantages: + simplifies debugging, as the self pointer also contains the private data. + removes a small overhead of tracking the private data separately - is a different way to implement the class, contrary to many other classes. - inheriting from the class later requires reverting this change (but we will never inherit from NMManager). - as it is now, nobody uses the priv field directly and we still access it via NM_MANAGER_GET_PRIVATE(self). However, the presence of the priv field might encourage us to use it directly -- which increases above disadvantages.
* manager: make NMManager's structs privateThomas Haller2016-04-282-8/+8
| | | | | They are only useful when we want to derive a class from NM_TYPE_MANAGER -- which we clearly don't.
* manager: remove unused signal slots from NMManagerClassThomas Haller2016-04-282-11/+3
|
* sleep-monitor: merge branch 'th/sleep-monitor-merge-bgo765682'Thomas Haller2016-04-286-241/+119
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=765682
| * sleep-monitor: make sleep-monitor not a singletonThomas Haller2016-04-283-18/+12
| | | | | | | | | | | | | | | | | | The only user of the sleep-monitor singleton was NMManager anyway. Also, even if we ever get more users that are interested in the SLEEPING signal, we would hook them onto NMManager -- because NMManager should collect, coordinate and possibly forward the SLEEPING signal. In no case, another object should react on the SLEEPING signal and thus bypassing the NMManager.
| * sleep-monitor: merge RESUMING signal into NMSleepMonitor's SLEEPING signalThomas Haller2016-04-283-36/+13
| | | | | | | | | | Having two signals is more complicated and everybody who cares about one signal also cares about the other.
| * sleep-monitor: unify and cleanup loggingThomas Haller2016-04-281-24/+35
| |
| * sleep-monitor: create D-Bus proxy asynchronously for upower sleep-monitorThomas Haller2016-04-281-33/+16
| |
| * sleep-monitor: cleanup #if usage by using USE_UPOWER in "nm-sleep-monitor.c"Thomas Haller2016-04-281-10/+10
| |
| * sleep-monitor: use defines for D-Bus paths for upower's sleep-monitorThomas Haller2016-04-281-9/+14
| |
| * sleep-monitor: use dispose() method for upower's sleep-monitorThomas Haller2016-04-281-18/+7
| |
| * sleep-monitor: merge "nm-sleep-monitor-upower.c" into "nm-sleep-monitor.c"Thomas Haller2016-04-283-143/+63
| | | | | | | | | | | | | | Both files do very similar things, with "nm-sleep-monitor-upower.c" being suboptimal, for example by creating the proxy synchronously. Clean that up in the next steps. Just basic merging for now.
| * sleep-monitor: rename file "nm-sleep-monitor-systemd.c" to "nm-sleep-monitor.c"Thomas Haller2016-04-282-1/+1
| | | | | | | | Next, we will merge "nm-sleep-monitor-upower.c" into "nm-sleep-monitor.c".
| * sleep-monitor/trivial: rename "sd_proxy" instance to "proxy"Thomas Haller2016-04-281-18/+18
| | | | | | | | It's not only relevant for systemd (sd).
| * po: remove file "src/nm-sleep-monitor-systemd.c" from POTFILES.in as it has ↵Thomas Haller2016-04-281-1/+0
|/ | | | | | no translations Fixes: 753f727af566a56e548613c35a3ccffe3d212d3b
* platform: merge branch 'th/platform-route-cleanup-bgo765432'Thomas Haller2016-04-2830-276/+405
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=765432
| * platform: add nm_linux_platform_lookup()Thomas Haller2016-04-283-2/+19
| | | | | | | | | | Give a direct access to the cache to lookup values there. This is only useful for testing.
| * platform: change order in which fields are compared in ↵Thomas Haller2016-04-281-9/+7
| | | | | | | | | | | | | | | | | | | | | | nm_platform_ip4_route_cmp() ..., nm_platform_ip6_route_cmp(), nm_platform_ip4_address_cmp() and nm_platform_ip6_address_cmp(). Compare those fields first, for which we expect that their properties differ. E.g. usually, each route destination in a set is unique, thus by comparing those fields first we shortcut some comparisons.
| * platform: extend NMIPConfigSource to preserve the rtm_protocol fieldThomas Haller2016-04-289-90/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For addresses (NMPlatformIPAddress) the @addr_source field is ignored on a platform level. That is, all addresses inside the platform cache have this value set to NM_IP_CONFIG_SOURCE_KERNEL. Maybe, for that reason, the source should not be a part of the NMPlatformIPAddress structure, but it is convenient for users to piggy back the source inside the platform address structure. For routes, the source is stored in NMPlatformIPRoute's @rt_source field. When adding a route to kernel, we set the @rtm_protocol of the route depending on the source. However, we want to map different source values to the same protocol value. On the other hand, when kernel sends us a route that gets put inside the cache, we must preserve the protocol value and must not map different protocol values to the same source. The reason is, that a user can add two routes that only differ by @rtm_protocol. In that sense, the @rtm_protocol fields is part of the unique ID of a kernel route, and thus different values must map to different sources. Fix this, by extending the range of NMIPConfigSource to contain a range of protocol fields.
| * platform: refactor marking cloned routes in platformThomas Haller2016-04-286-10/+20
| | | | | | | | | | | | | | | | | | | | We handle cloned routes (that have rtm_flags RTM_F_CLONED) differently. We used to mark such routes by hacking NMIPConfigSource to have a special value. No longer do this, because it mixes different concepts. Note that the rt_cloned filed fits into a hole in the aligment of NMPlatformIPRoute. Thus there is almost no overhead to this change.
| * platform: add nmp_utils_ip_config_source_to_string()Thomas Haller2016-04-283-40/+24
| | | | | | | | | | Expose nmp_utils_ip_config_source_to_string() in the header file and implement it via NM_UTILS_ENUM2STR_DEFINE().
| * core/trivial: rename "source" field of addresses and routesThomas Haller2016-04-2822-175/+173
| | | | | | | | | | | | | | | | | | | | The "source" field of NMPlatformIPRoute (now "rt_source") maps to the protocol field of the route. The source of NMPlatformIPAddress (now "addr_source") has no direct equivalent in the kernel. As their use is different, they should have different names. Also, the name "source" is used all over the place. Hence give the fields a more distinct name.
| * platform: sort links by ifindex in nm_platform_link_get_all()Thomas Haller2016-04-281-9/+21
| | | | | | | | | | | | | | | | This way, we get a defined order at startup. Also, get rid of the logging statements. It was used for debugging, but a "getter" really should not log the stuff it is returning.
| * core: add nm_utils_ipx_address_clear_host_address() utilThomas Haller2016-04-283-18/+23
|/
* cli: remove version check against NMFrancesco Giudici2016-04-2876-1370/+3
| | | | | | | | | | | | When performing NM package upgrade the new version of nmcli will be immediately available while NM daemon will not, as it would not restart in order to avoid to disrupt connectivity. This could create issues with tools leveraging on nmcli output (till reboot). As apart from this case it is very unlikely that a user can have this nmcli / NM daemon version mismatch situation, the check could cause more harm than benefit in real user case scenarios. https://bugzilla.redhat.com/show_bug.cgi?id=1291785
* device/ethernet: ignore s390 'portname' attribute when not setBeniamino Galvani2016-04-281-6/+11
| | | | | | | | | The 'portname' sysfs attribute of s390 devices is deprecated since kernel 4.4 and always set to 'no portname required'. But even on older kernels such value must be interpreted as an unset portname and thus ignored. https://bugzilla.redhat.com/show_bug.cgi?id=1327204
* manager: use _LOGx() macros in nm-managerThomas Haller2016-04-271-36/+42
| | | | They give each logging message a "manager: " prefix.
* merge: branch 'bg/gateway-never-default-rh1313091-v2'Beniamino Galvani2016-04-274-1/+81
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1313091
| * ifcfg-rh: emit a warning when DEFROUTE=no and GATEWAY is setBeniamino Galvani2016-04-271-0/+5
| |
| * libnm-core: remove gateway when never-default=yes in NMSettingIPConfigBeniamino Galvani2016-04-273-1/+76
|/ | | | | | | | | | Having a gateway defined when never-default=yes causes troubles in connection matching and anyway makes no sense. If the combination is found, remove the gateway during the normalization phase. https://bugzilla.redhat.com/show_bug.cgi?id=1313091
* settings: fix write_hostname for relative-symbolic linksThomas Haller2016-04-271-1/+1
| | | | | | g_file_read_link() "reads" the symbolic link. If it's a relative path, we get a relative path which is anchored on @file. We must resolve that to be absolute.
* settings: remove unnecessary "file" field for hostname from NMSettingPrivateThomas Haller2016-04-271-7/+5
|
* utils: add nm_utils_read_link_absolute()Thomas Haller2016-04-272-0/+35
|
* settings: add notification after connections loadFrancesco Giudici2016-04-271-0/+1
| | | | | | | The notification was missing from a long time. The issue has been exposed only now due to the c57e5a6b66b8a29d4c16dacf9aafc7ee04a27243 fix which properly implemented the "startup-complete" notification substituting out of place code which masked the bug.
* tui: quit from top-level form when exitingBeniamino Galvani2016-04-271-1/+15
| | | | | | | The top-level form was left on screen after exit (this is visible only on some types of terminal as vt100), breaking automated tests. Fixes: b2fb80928e27dc29240e604bab4f391302fc71f3
* settings: disconnect connection_ready_changed() handler when reaching ↵Thomas Haller2016-04-261-2/+12
| | | | | | | | startup_complete We connect to notify::startup-complete signal of each connection, but after we signal startup-complete once, we don't need that signal anymore. Disconnect.
* dns: merge branch 'th/dns-rc-manager-bgo765387'Thomas Haller2016-04-264-154/+151
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=765387
| * dns: add new rc-manager=unmanagedThomas Haller2016-04-262-1/+6
| | | | | | | | | | | | | | | | | | | | | | The following settings are effectively identical: dns=none,rc-manager=*any* dns=none,rc-manager=unmanaged dns=default,rc-manager=unmanaged The new setting is only there for completeness and only makes sense for a dns plugin.
| * dns: merge the dns "mode" and "rc-manager"Thomas Haller2016-04-263-115/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Already previously, the mode and rc-manager were intertwined in a complicated way: - dns=none effectively disables rc-manager. - if resolv.conf was immutable, it would disable the rc-manager by setting "resolv_conf_mode=NM_DNS_MANAGER_RESOLV_CONF_UNMANAGED". - resolv_conf_mode was anyway a redundant piece of information to rc_manager. Now there are only two relevant settings: priv->plugin and priv->rc_manager. And they can be set independently from each other. Before that was not possible. For example, you could not set a dns plugin with rc-manager=unmanaged (the only way to achive that was via an immutable resolv.conf or by having rc-manager=symlink and let resolv.conf link somewhere else.
| * dns: when clearing "plugin" always disconnect signal handlersThomas Haller2016-04-261-6/+14
| |
| * dns: initialize rc-manager in init_resolv_conf_mode()Thomas Haller2016-04-261-24/+13
| | | | | | | | | | | | | | | | The "dns" and "rc-manager" properties are strongly related. Initialize them together in init_resolv_conf_mode(). One difference is, that we now set rc_manager before setting the mode. But that shouldn't matter.
| * dns: split parsing of rc-manager out of init_resolv_conf_manager()Thomas Haller2016-04-262-25/+51
| | | | | | | | | | Makes more sense in the next commit, when init_resolv_conf_manager() gets merged with init_resolv_conf_mode(). Bear with me.
| * dns: rename "rc-manager=none" to "symlink"Thomas Haller2016-04-263-12/+14
|/ | | | | | We already have "rc-manager=file", rename "rc-manager=none" to "symlink" because that better describes what it is actually doing. Of course, the old name is still accepted.