Commit graph

11663 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
59b64ffa82 dns: fix falling back in the resolv.conf methods 2015-05-06 14:28:24 -05:00
Thomas Haller
02877dcd30 core: merge branch 'th/waitpid-bgo748885'
https://bugzilla.gnome.org/show_bug.cgi?id=748885

(cherry picked from commit 4d4f5fff5c)
2015-05-05 17:18:42 +02:00
Thomas Haller
db87f280f0 dispatcher: repeat waitpid() call on EINTR
Also, no use of first trying to kill() with signal zero. Just
send SIGKILL right away.

(cherry picked from commit 22bfe2feb2)
2015-05-05 17:17:41 +02: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
d546f8e2cc release: bump version to 1.0.3 2015-05-05 17:02:24 +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
Lubomir Rintel
e224d96f69 config,connectivity: merge branch 'lr/nm-1-0-rh1066697_reload_config'
Refactor NMConfig to support reloading.

Implement reloading of NMConnectivity parameters

https://bugzilla.redhat.com/show_bug.cgi?id=1066697
2015-05-05 16:53:16 +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
Dan Williams
1d8a2a2662 settings: remove 'do_export' argument from claim_connection()
It was always TRUE, and unused anyway.

(cherry picked from commit bbcf5444fd)
2015-05-05 16:37:06 +02:00
Dan Williams
de9a34cc42 settings/dbus: harden connection removal and object unexport
None of these functions was checking if the same operation had already
been performed, or if the object being removed/unexported was known.

(cherry picked from commit fe96dbc0ee)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
89d96b87d8 manager: don't try to delete generated connection if it's already gone
Move the cleanup of the generated assumed connection to active connection
dispose. If the connection vanishes earlier (explicit deletion from client),
tear down the reference so that we don't try to remove it redundantly.

  NetworkManager[9221]: <info>  (eth2): device state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38]
  NetworkManager[9221]: <info>  (eth2): deactivating device (reason 'connection-removed') [38]

  (NetworkManager:9221): GLib-GObject-WARNING **: g_object_weak_unref: couldn't find weak ref 0x496610(0x7c2ba0)

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x7ffff4d4f1a4 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd860) at gmessages.c:1046
  1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  (gdb) bt
  #0  0x00007ffff4a2cc60 in g_logv (log_domain=0x7ffff4d4f1a4 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffd860) at gmessages.c:1046
  #1  0x00007ffff4a2ce9f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1079
  #2  0x000000000049780b in nm_dbus_manager_unregister_object (self=0x7c2ba0 [NMDBusManager], object=0x80f3e0) at nm-dbus-manager.c:921
  #3  0x000000000047cc83 in nm_settings_connection_signal_remove (self=self@entry=0x80f3e0 [NMIfcfgConnection]) at settings/nm-settings-connection.c:1752
  #4  0x000000000047cd22 in do_delete (connection=0x80f3e0 [NMIfcfgConnection], callback=0x479d60 <ignore_cb>, user_data=0x0) at settings/nm-settings-connection.c:687
  #5  0x00000000004b1eb6 in active_connection_remove (self=self@entry=0x8701c0 [NMManager], active=active@entry=0x8b02f0) at nm-manager.c:292
  #6  0x00000000004b2174 in _active_connection_cleanup (user_data=<optimized out>) at nm-manager.c:316
  #7  0x00007ffff4a25aeb in g_main_context_dispatch (context=0x7be3a0) at gmain.c:3111
  #8  0x00007ffff4a25aeb in g_main_context_dispatch (context=context@entry=0x7be3a0) at gmain.c:3710
  #9  0x00007ffff4a25e88 in g_main_context_iterate (context=0x7be3a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
  #10 0x00007ffff4a261b2 in g_main_loop_run (loop=0x7be460) at gmain.c:3975
  #11 0x0000000000432f55 in main (argc=1, argv=0x7fffffffded8) at main.c:460
  (gdb)

https://bugzilla.gnome.org/show_bug.cgi?id=744812
(cherry picked from commit 74ed416d84)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
a4369ef841 nm-settings: add nm_settings_has_connection()
Useful for checking if a connection is already deleted.

https://bugzilla.gnome.org/show_bug.cgi?id=744812
https://bugzilla.redhat.com/show_bug.cgi?id=1174164
(cherry picked from commit 8a00bb36ec)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
12a68c9e99 nm-remote-connection: take a reference to self while calling get_settings
(process:6888): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GDBusProxy'

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x3149a3b224 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffda70) at gmessages.c:1046
  1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  (gdb) bt
  #0  0x0000003148e50c70 in g_logv (log_domain=0x3149a3b224 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffda70) at gmessages.c:1046
  #1  0x0000003148e50eaf in g_log (log_domain=log_domain@entry=0x3149a3b224 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x3149a42690 "invalid unclassed pointer in cast to '%s'") at gmessages.c:1079
  #2  0x0000003149a34171 in g_type_check_instance_cast (type_instance=type_instance@entry=0x6fc530, iface_type=<optimized out>) at gtype.c:4030
  #3  0x00007ffff7d6b016 in nmdbus_settings_connection_call_get_settings_finish (proxy=0x6fc530, out_settings=out_settings@entry=0x7fffffffdbb8, res=res@entry=0x6fe150, error=error@entry=0x0)
      at nmdbus-settings-connection.c:1303
  #4  0x00007ffff7ce8813 in updated_get_settings_cb (proxy=<optimized out>, result=0x6fe150, user_data=user_data@entry=0x6fc650) at nm-remote-connection.c:588
  #5  0x000000314a27640d in g_simple_async_result_complete (simple=0x6fe150 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #6  0x000000314a2df47c in reply_cb (connection=<optimized out>, res=0x6fe0e0, user_data=user_data@entry=0x6fe150) at gdbusproxy.c:2623
  #7  0x000000314a27640d in g_simple_async_result_complete (simple=0x6fe0e0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #8  0x000000314a2d48cc in g_dbus_connection_call_done (source=<optimized out>, result=<optimized out>, user_data=user_data@entry=0x7fffec01a320) at gdbusconnection.c:5502
  #9  0x000000314a27640d in g_simple_async_result_complete (simple=0x6e5f40 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #10 0x000000314a27647c in complete_in_idle_cb (data=0x6e5f40) at gsimpleasyncresult.c:775
  #11 0x0000003148e49b6b in g_main_context_dispatch (context=0x687970) at gmain.c:3064
  #12 0x0000003148e49b6b in g_main_context_dispatch (context=context@entry=0x687970) at gmain.c:3663
  #13 0x0000003148e49f08 in g_main_context_iterate (context=0x687970, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3734
  #14 0x0000003148e4a232 in g_main_loop_run (loop=0x687a80) at gmain.c:3928
  #15 0x00000000004136a1 in main (argc=<optimized out>, argv=<optimized out>) at nmcli.c:632
  (gdb)

(cherry picked from commit 9d3b31e1ae)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
5359322b6d bond: allow overriding the MTU
Set the MTU if 802-3-ethernet.mtu is present and non-zero. The ifcfg-rh writer
sets it if there's a MTU key.

https://bugzilla.redhat.com/show_bug.cgi?id=1177582
(cherry picked from commit a169a79a7d)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
6a8a4d0c28 nm-device: avoid improper IPv6 MTU configuration
Ensure it's always (before address configuration starts and on updates) >= 1280
and not higher than the device MTU.

(cherry picked from commit fbf3a93c6bb88632ca4c8480ddbd04ca1dee151a)
2015-05-05 16:37:06 +02:00
Lubomir Rintel
9b79e6c732 nm-device: move device MTU setting from IP4Config to NMDevice
Just a refactoring, no functional change. This will make it easier to
coordinate the device MTU with IPv6 MTU.

(cherry picked from commit 86696e17fd205de91e36998d524584335163d32b)
2015-05-05 16:37:06 +02:00