Commit graph

5831 commits

Author SHA1 Message Date
Lubomir Rintel
93409da4dc core: don't assume the loopback interface is called "lo"
I did a "ip link set lo name yolo" and now my NetworkManager triggers an
assertion failure. :( Nevertheless, the loopback interface is always ifindex=1.

(cherry picked from commit 36f7669a4c)
2015-06-04 14:40:22 +02:00
Lubomir Rintel
9ce3e5e76e platform-linux: allow netlink messages from non-privileged user namespaces
Just check they're from kernel.

(cherry picked from commit ef295ddeef)
2015-06-04 14:39:49 +02:00
Jiří Klimeš
cf059e4513 dbus: increase 'max_replies_per_connection' limit in D-Bus configuration
D-Bus default limit of replies per connection has been lowered to 128 due to
CVE-2014-3638, see:
http://cgit.freedesktop.org/dbus/dbus/commit/?id=5bc7f9519ebc6117ba300c704794b36b87c2194b
https://bugs.freedesktop.org/show_bug.cgi?id=81053

The limit seems to be too low and causes problems in libnm-glib, that will not
return all NetworkManager connection profiles if there are too many of them
(roughly more than the limit). As a consequence, libnm-glib based clients will
not work properly.

Lets increase the limit in our D-Bus org.freedesktop.NetworkManager.conf
configuration as we had it before.

See also older commit d5b31d55fa that did the
opposite thing (removing the limit because the default D-Bus limit was 8192 at
that time).
2015-05-29 08:29:04 +02:00
Dan Williams
a0ec4bf521 vpn: don't fail if no system secrets exist
The VPN connection requests secrets a few times; first it retrieves
only system-owned secrets to see if they are sufficient (and thus
doesn't need to bother the user), then it retrieves existing agent
owned secrets (so the user doesn't get a popup), then finally if
those aren't sufficient it asks the user interactively.

But if there was some error retrieving system secrets, or if there
weren't any system secrets at all, don't fail the VPN connection.
Just go on and ask the user for the secrets.

(cherry picked from commit 5b1cde1bfc)
2015-05-20 14:26:48 -05:00
Dan Williams
aaf6e6b1cf systemd: fix build with toolchains not exporting CLOCK_BOOTTIME
See 123322c6d6 for the NM-side fix.  We
need this too for the systemd code.

(cherry picked from commit e47eca8761)
2015-05-19 16:04:23 -05:00
Thomas Haller
928494af2b connectivity: use default on missing connectivity.interval config
Manual page claims that a missing configuration option for connectivity
interval means "300". That was not the case for a long time (never?).

https://bugzilla.gnome.org/show_bug.cgi?id=723350

Based-on-patch-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
(cherry picked from commit 652853e0d0)

Conflicts:
	src/nm-config-data.c
2015-05-19 15:37:14 +02:00
Thomas Haller
68582b5eff config: return internal field directly in nm_config_data_get_connectivity_interval()
We already initialize connectivity.interval apprepriately in constructor().
No need to MAX() it again.

(cherry picked from commit 5b04fde302)
2015-05-19 15:35:28 +02:00
Thomas Haller
9fbd4c17fa config: minor fix in read_entire_config()
Calling read_entire_config() without passing a @cli argument would
always have caused an assert due to unset @o_config_main_file.
That is not a real problem as that situation didn't arise. Still
fix it.

(cherry picked from commit ae0608eef5)
2015-05-19 15:35:24 +02:00
Beniamino Galvani
79c80f00cc dns: don't override DHCP-supplied search order with domain
NM always prepends the list of DNS domains received through DHCP to
the search list in /etc/resolv.conf, overriding the DHCP-supplied DNS
domain search order. This behavior is not entirely correct since it
changes the search order provided by system administrators.

We cannot simply avoid adding the DNS domain list to the search list
because this would break some configurations that rely on the 'domain'
option to deliver the search list.

This patch modifies the behavior of DNS manager to:
 - insert the DHCP-provided 'domain' at the end of 'searches' option
   so that 'searches' is always preferred
 - ignore 'domain' if 'searches' option exists and 'domain' is a
   single domain

https://bugzilla.gnome.org/show_bug.cgi?id=748900
(cherry picked from commit 6edc737173)
2015-05-17 19:25:17 +02:00
Thomas Haller
c531edc002 device/logging: downgrade log level of "Activation: Stage x of 5" messages
Only downgrade the <info> levels to <debug>. Leave
warnings unchanged.

https://bugzilla.redhat.com/show_bug.cgi?id=1212196
(cherry picked from commit 255f30c362)
2015-05-13 18:44:20 +02:00
Thomas Haller
c593be5c49 core/logging: reduce info logging messages for devices
https://bugzilla.redhat.com/show_bug.cgi?id=1212196
(cherry picked from commit b91b8a035c)
2015-05-13 18:44:15 +02:00
Thomas Haller
8da0a8104a device/logging: log connection UUID when activating connection
It is often hard to understand whether we activate an assumed
connection. Only the UUID is unique.

(cherry picked from commit 9983e4eff5)
2015-05-13 18:44:07 +02:00
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