Commit graph

5819 commits

Author SHA1 Message Date
Thomas Haller
3d17c73576 core/logging: adjust log line about loading setting plugins
We have different kinds of plugins (settings, dhcp, dns).
Clearify, that we are about to load "settings" plugins.

(cherry picked from commit e9b9d9b627)
2015-05-13 18:44:02 +02:00
Thomas Haller
bd83000816 core/logging: downgrade some <info> loggings to <debug>
These logging statements are compile time dependent and
add little informational value.

(cherry picked from commit d8e1d9b469)
2015-05-13 18:43:57 +02:00
Thomas Haller
80aaf076cf device: expose nm_device_has_capability() function
(cherry picked from commit 756b756c2c)
2015-05-13 18:43:51 +02:00
Thomas Haller
0c227e6b62 device: use NMDeviceCapabilities enum for device capabilities
(cherry picked from commit 2117bef864)
2015-05-13 18:43:40 +02:00
Thomas Haller
b67d017619 platform/test: include call location in signal assertions
Hard to debug failures, if we don't print where the failure
happens.

(cherry picked from commit 500cbcba21)

Conflicts:
	src/platform/tests/test-common.c
2015-05-13 16:07:36 +02:00
Thomas Haller
adc145f537 platform/test: make asserting signals more flexible
Support accepting more then one signal at a time.
It is to be expected, that one change in platform raises
several signals. Extend the assertion helpers to express
that.

(cherry picked from commit 050c644cce)
2015-05-13 16:07:36 +02:00
Thomas Haller
495209c145 platform: fix nm_platform_link_cmp() to consider ifindex
(cherry picked from commit f167346534)
2015-05-13 16:07:36 +02:00
Thomas Haller
7234352fd7 platform: fix memleak in link_delete()
Turns out, the valgrind suppression was hiding a memleak

(cherry picked from commit 0c258402c7)
2015-05-13 16:07:36 +02:00
Thomas Haller
0f90e60df9 platform/test: refactor detection of root-test
(cherry picked from commit 313af401d3)
2015-05-13 16:07:35 +02:00
Thomas Haller
c40e32c275 config: fix memleak of keyfile in finalize() of NMConfigData
Fixes: 9809eb4da1
2015-05-13 16:07:35 +02:00
Lubomir Rintel
14c2c6f3f9 trivial: remove a tautological compare
Unsigned enum is always >= 0.

(cherry picked from commit a43f95b0ac)
2015-05-11 15:31:16 +02:00
Lubomir Rintel
342509559f device: make sure NMDevice doesn't vanish halfway through applying configuration
It could be that the device was removed and the default route manager holds the
last reference:

  Breakpoint 1, dispose (object=0x90e710 [NMDeviceTun]) at devices/nm-device.c:8588
  8588            NMDevice *self = NM_DEVICE (object);
  (gdb) bt
  #0  0x000000000045d24e in dispose (object=0x90e710 [NMDeviceTun]) at devices/nm-device.c:8588
  #1  0x00007ffff4d29b7c in g_object_unref (_object=0x90e710) at gobject.c:3133
  #2  0x00000000004b0a61 in _entry_at_idx_remove (entry=<optimized out>) at nm-default-route-manager.c:192
  #3  0x00000000004b0a61 in _entry_at_idx_remove (vtable=<optimized out>, self=<optimized out>, entry_idx=<optimized out>) at nm-default-route-manager.c:638
  #4  0x00000000004adb51 in _ipx_update_default_route (vtable=0x7b1850 <vtable_ip6>, self=0x7da610 [NMDefaultRouteManager], source=<optimized out>) at nm-default-route-manager.c:814
  #5  0x0000000000459ccb in nm_device_set_ip6_config (self=0x90e710 [NMDeviceTun], new_config=<optimized out>, commit=<optimized out>, reason=<optimized out>) at devices/nm-device.c:6213
  #6  0x0000000000450c92 in ip6_config_merge_and_apply (self=0x90e710 [NMDeviceTun], commit=0, out_reason=0x0) at devices/nm-device.c:3670
  #7  0x0000000000452d06 in update_ip_config (self=0x90e710 [NMDeviceTun], initial=<optimized out>) at devices/nm-device.c:6915
  #8  0x000000000046253e in queued_ip_config_change (user_data=<optimized out>) at devices/nm-device.c:6945
  #9  0x00007ffff4a257fb in g_main_context_dispatch (context=0x7ca3e0) at gmain.c:3111
  #10 0x00007ffff4a257fb in g_main_context_dispatch (context=context@entry=0x7ca3e0) at gmain.c:3710
  #11 0x00007ffff4a25b98 in g_main_context_iterate (context=0x7ca3e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
  #12 0x00007ffff4a25ec2 in g_main_loop_run (loop=0x7ca4a0) at gmain.c:3975
  #13 0x0000000000444bbe in main (argc=<optimized out>, argv=<optimized out>) at main.c:486
  (gdb)

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x7ffff4d4f164 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd5b0) at gmessages.c:1046
  1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  (gdb) bt
  #0  0x00007ffff4a2c970 in g_logv (log_domain=0x7ffff4d4f164 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd5b0) at gmessages.c:1046
  #1  0x00007ffff4a2cbaf in g_log (log_domain=log_domain@entry=0x7ffff4d4f164 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x7ffff4d563b0 "invalid unclassed pointer in cast to '%s'") at gmessages.c:1079
  #2  0x00007ffff4d481f9 in g_type_check_instance_cast (type_instance=0x90e710, iface_type=<optimized out>) at gtype.c:4030
  #3  0x0000000000459ceb in nm_device_set_ip6_config (self=0x90e710, new_config=<optimized out>, commit=<optimized out>, reason=0x0) at devices/nm-device.c:6217
  #4  0x0000000000450c92 in ip6_config_merge_and_apply (self=0x90e710, commit=0, out_reason=0x0) at devices/nm-device.c:3670
  #5  0x0000000000452d06 in update_ip_config (self=0x90e710, initial=<optimized out>) at devices/nm-device.c:6915
  #6  0x000000000046253e in queued_ip_config_change (user_data=<optimized out>) at devices/nm-device.c:6945
  #7  0x00007ffff4a257fb in g_main_context_dispatch (context=0x7ca3e0) at gmain.c:3111
  #8  0x00007ffff4a257fb in g_main_context_dispatch (context=context@entry=0x7ca3e0) at gmain.c:3710
  #9  0x00007ffff4a25b98 in g_main_context_iterate (context=0x7ca3e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
  #10 0x00007ffff4a25ec2 in g_main_loop_run (loop=0x7ca4a0) at gmain.c:3975
  #11 0x0000000000444bbe in main (argc=<optimized out>, argv=<optimized out>) at main.c:486
  (gdb)

https://bugzilla.gnome.org/show_bug.cgi?id=748193
(cherry picked from commit 6fba9fd2e5)
2015-05-11 10:44:26 +02:00
Jan Alexander Steffens (heftig)
59b64ffa82 dns: fix falling back in the resolv.conf methods 2015-05-06 14:28:24 -05:00
Thomas Haller
57518271d6 dns-manager: fail dns config if netconfig exits with non-zero status
If netconfig does not exit with zero status signal, assume
configuration failed and signal an error.

(cherry picked from commit 5f0c23f106)
2015-05-05 17:17:41 +02:00
Thomas Haller
20ff7d9688 dns-manager: use nm_utils_kill_child_sync() to wait for netconfig to exit
(cherry picked from commit 6b646a1e37)

Conflicts:
	src/dns-manager/nm-dns-manager.c
2015-05-05 17:17:07 +02:00
Thomas Haller
69f92f131a utils: preserve errno in nm_utils_kill_child_sync()
(cherry picked from commit ca4361bd53)
2015-05-05 17:16:29 +02:00
Thomas Haller
07433c81c7 config: fix filename order for config-description
The configuration snippets are loaded in alphabetical order.
Fix the printed description to reflect that order. Otherwise,
NM logs at startup:

  <info>  Read config: /etc/NetworkManager/NetworkManager.conf and conf.d: 20-connectivity-fedora.conf, 10-ibft-plugin.conf

(cherry picked from commit 6b0f84bdda)
2015-05-05 17:13:11 +02:00
Lubomir Rintel
33f9aab314 dns-manager: react to dns management mode changes
Load a different plugin when the configuration changes.

https://bugzilla.redhat.com/show_bug.cgi?id=1062301

(cherry picked from commit 73e8aeadba)
2015-05-05 16:59:45 +02:00
Lubomir Rintel
68d9a8edac config: move dns mode configuration to NMConfigData
This will make is possible for the NMDnsManager to watch for
configuration changes.

https://bugzilla.redhat.com/show_bug.cgi?id=1062301

(cherry picked from commit aa672b2dc2)
2015-05-05 16:59:42 +02:00
Thomas Haller
d9f372f439 config: use flags argument in config-changed signal instead of a hash table
(cherry picked from commit 5b47462f32)
2015-05-05 16:51:54 +02:00
Thomas Haller
0efcf3c680 config: make NMConfig implement GInitable
(cherry picked from commit cc46b182ed)
2015-05-05 16:51:50 +02:00
Thomas Haller
41598c1f1a config: move no-auto-default to NMConfigData
With this change, NMConfig is really immutable and all
modifyable parts migrated to NMConfigData.

Another advantage is that components can now subscribe to
NMConfig changes to pickup changes to no-auto-default.

(cherry picked from commit 13c7f6a56d)
2015-05-05 16:51:43 +02:00
Thomas Haller
b85c3c4d6b config: refactor merging no_auto_default
(cherry picked from commit 49b3f5b8d9)
2015-05-05 16:51:39 +02:00
Thomas Haller
9809eb4da1 config: move keyfile values to NMConfigData
(cherry picked from commit ba74f9d242)
2015-05-05 16:51:33 +02:00
Thomas Haller
c9aca6f36b config: add new function nm_config_data_diff()
(cherry picked from commit 045a576a7a)
2015-05-05 16:51:28 +02:00
Thomas Haller
0ca82739d5 config: move main_file and description to NMConfigData
Every reload might change the main_file and description.
Move those properties to NMConfigData.

(cherry picked from commit 56f5fba723)
2015-05-05 16:51:21 +02:00
Thomas Haller
30a4786468 config: refactor reloading not to create a second NMConfig instance
(cherry picked from commit 699b12ddc9)
2015-05-05 16:51:15 +02:00
Thomas Haller
c2d7454760 config: minor refactoring to highlight mutable property no_auto_default of NMConfig
(cherry picked from commit 83996c621c)
2015-05-05 16:51:10 +02:00
Thomas Haller
8ba5e062b2 config: refactor read_entire_config() to merge command line options
(cherry picked from commit 64520b7ba4)
2015-05-05 16:51:05 +02:00
Thomas Haller
f166c007fb config: refactor to inject NMConfigCmdLineOptions to NMConfig constructor
(cherry picked from commit 4429f8aea5)
2015-05-05 16:51:00 +02:00
Thomas Haller
ca6f06d069 config: refactor nm_config_new() by extracting function read_entire_config()
(cherry picked from commit 40dc4c3242)
2015-05-05 16:50:55 +02:00
Thomas Haller
cfc435be0b config: refactor nm_config_new() by extracting function _get_config_dir_files()
(cherry picked from commit ef57828442)
2015-05-05 16:50:50 +02:00
Thomas Haller
83edb5aee3 config/trivial: rename variables for configuration file
The name "nm_conf_path" and cli.config_path" were not consistent.
Rename them both to "config_main_file".

(cherry picked from commit 3714a6c7bd)
2015-05-05 16:50:25 +02:00
Thomas Haller
67c4398170 config: refactor read_config() to make it independent from NMConfig
(cherry picked from commit 3c7f71e44a)
2015-05-05 16:50:20 +02:00
Thomas Haller
244cc0171a config: implement reloading of connectivity parameters
(cherry picked from commit b814c3122a)
2015-05-05 16:50:15 +02:00
Thomas Haller
b18de2309a connectivity: make NMConnectivity independent of NMConfig
(cherry picked from commit ac9dd4c832)
2015-05-05 16:50:10 +02:00
Thomas Haller
63293bba19 config: add support for reloading of configuration
No actual reloading is yet implemented. Later we will decide
on specific configuration parameters where we support reloading.
They must be then implemented one-by-one.

Some configuration parameters can be set via command line.
If a parameter is set from command line, the original value
from command line will still be preserved after reloading.

(cherry picked from commit 82cfd5ad47)
2015-05-05 16:50:03 +02:00
Thomas Haller
3a5fb56b60 config: add handler for SIGHUP and a reload-configuration stub
(cherry picked from commit d62022e28a)
2015-05-05 16:49:58 +02:00
Thomas Haller
a56fe5ae0c config: use NMConfigData in NMConfig
(cherry picked from commit 50fce5a860)
2015-05-05 16:49:51 +02:00
Thomas Haller
5a7506a405 config: add new NMConfigData class
The NMConfig class should be immutable and its properties should
not change, with one exception: the NMConfigData property.

Later, when changing/reloading a configuration, NMConfig will only swap
the NMConfigData instance.

The NMConfigData instance itself is also immutable.

(cherry picked from commit 076478505d)
2015-05-05 16:49:44 +02:00
Thomas Haller
b4ad7434a8 config: add nm_config_setup() to initialize config singleton
Make nm_config_new() usable without accessing static/singleton data.

nm_config_setup() is now used to initialize the singleton.
Still, you must not call nm_config_get() before calling
nm_config_setup() or after freeing the provided singleton
instance.

(cherry picked from commit 1ff5154369)
2015-05-05 16:49:38 +02:00
Thomas Haller
d165559ef2 config/trivial: fix returning FALSE instead of NULL in nm_config_new()
(cherry picked from commit 9387e8e8a7)
2015-05-05 16:49:31 +02:00
Thomas Haller
0799617515 config: forward declare NMConfig in nm-types.h
(cherry picked from commit 86ac1ad7bd)
2015-05-05 16:49:24 +02:00
Thomas Haller
9d5b4baf36 connectivity: add logging macros to nm-connectivity.c
They add a common prefix to all logging lines.

(cherry picked from commit 3ed4aa271a)
2015-05-05 16:49:18 +02:00
Thomas Haller
b4d7ac70f2 connectivity: refactor handling parameters of NMConnectivity
Currently the three parameters for the connectivity check (uri, interval, response)
don't get reset. Soon they might be modified at any time when reloading the
configuration.

When calling the asynchronous HTTP connectivity check, we want to
preserve the original parameters so that the result callback still can
access them later. Pass the uri and response parameter on as
ConCheckCbData.

(cherry picked from commit 5ee18c124b)
2015-05-05 16:49:11 +02:00
Thomas Haller
fc6f45e42a connectivity: refactor converting connectivity states to string
(cherry picked from commit 78e3b4866a)
2015-05-05 16:49:01 +02:00
Thomas Haller
6f4bf2818a connectivity: add missing G_PARAM_CONSTRUCT for NM_CONNECTIVITY_URI property
(cherry picked from commit a79e9fdbb0)
2015-05-05 16:48:49 +02:00
Thomas Haller
da87866882 connectivity/trivial: fix white space and line-break in nm-connectivity.c
(cherry picked from commit 7aab5bc81c)
2015-05-05 16:48:40 +02:00
Thomas Haller
5929a4cbec connectivity: make NMConnectivity:dispose() reentrant
(cherry picked from commit 3dce101f6b)
2015-05-05 16:48:35 +02:00
Thomas Haller
72d06eb9c8 connectivity: add code comment to nm_connectivity_check_cb()
(cherry picked from commit 6cb5db60de)
2015-05-05 16:48:22 +02:00