Commit graph

11707 commits

Author SHA1 Message Date
Thomas Haller
c2e4e2f1fd core/test: add test for nm_match_spec()
(cherry picked from commit 9080ad696d)
2015-06-10 18:32:56 +02:00
Lubomir Rintel
ade0c9e05e manager: don't attempt to activate ipv6.method=shared connections
It would be nice if we supported IPv6 network sharing (maybe RFC 7278?),
but we don't. Let's not attempt to bring it up, it would fail in stage3.

https://bugzilla.redhat.com/show_bug.cgi?id=1183015
(cherry picked from commit 477033b9ef)
2015-06-09 19:02:50 +02:00
Lubomir Rintel
1bf060bf93 cli: don't look up a device for activation request unless we have to
Let the server decide which device to use if the user didn't explicitly
specify the interface, wireless access point or a wimax nsp.

The server will just reuse the device for an already active connection
or potentially do a better guess.

https://bugzilla.gnome.org/show_bug.cgi?id=730492
(cherry picked from commit 0e8a14cc5f)
2015-06-09 18:57:25 +02:00
Lubomir Rintel
33eca4b43c manager: remove a connection from device if we're activating it on another device
The connection now might be being activated on another device. Defer the
removal until we're sure the activation request will proceed and only add the
active connection afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=730492
(cherry picked from commit 4cb97cf66f)
2015-06-09 18:57:12 +02:00
Lubomir Rintel
ad81316f18 manager: pick an available device if none was specified upon connection activation
This offloads some complexity from the client.

https://bugzilla.gnome.org/show_bug.cgi?id=730492
(cherry picked from commit 6fc3736c7a)
2015-06-09 18:57:06 +02:00
Lubomir Rintel
f20910516d manager: reuse a device connection is active on if none was given upon activation
If a connection is already active let's keep it on the same device. This makes
it possible to reactivate a connection without client knowing which device is
it active on.

https://bugzilla.gnome.org/show_bug.cgi?id=730492
(cherry picked from commit 6e94f302b2)
2015-06-09 18:56:57 +02:00
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
Thomas Haller
6099378bc6 libnm: fix take ownership of floating argument in NMSecretAgentOld:get_secrets_cb()
The previous patch 9ffcecf86a was
completely wrong.

It tried to fix callers that provided a floating GVariant reference.
We require the caller to unref @secrets, so the correct fix it to
ensure that the reference is not floating.

Fixes: 6793a32a8c

(cherry picked from commit 9ffcecf86a)
(cherry picked from commit 2071e4794f)
2015-06-03 19:45:08 +02:00
Jiří Klimeš
e9e032bd51 merge: increase 'max_replies_per_connection' limit in D-Bus configuration
The limit seems to be too low and causes problems in libnm-glib. We increase
the limit and warn in libnm-glib if it was exceeded.

(cherry picked from commit 242fe0bfb0)
2015-05-29 08:29:31 +02:00
Jiří Klimeš
84b3cb25b5 libnm-glib: print a bold warning about reaching a D-Bus limit
This causes incorrect application behaviour, so libnm-glib should warn
at least.
2015-05-29 08:29:04 +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
19acc4987e Partially revert "dhcp: gracefully recover from failed DHCP BOUND state transitions (bgo #743700)"
This reverts commit 7daf63461d.

Turns out the removal of the second set of [] in configure.ac causes the command
to be wrong in 'configure' and the test to be incorrect.
2015-05-26 18:22:52 -05:00
Jiří Klimeš
394a867e69 libnm-glib: do not access NULL GError variable (rh #1224819)
dbus_g_proxy_call() should set GError if returning FALSE. But apparently there
is a bug in dbus-glib and the error can be NULL.

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

(cherry picked from commit f46eb1fc20)
2015-05-26 16:06:02 +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
474848c238 core: merge branch 'th/reduce-info-logging-rh1212196'
https://bugzilla.redhat.com/show_bug.cgi?id=1212196

(cherry picked from commit c47b9624e2d2fc9ccb09ced96c5b7e720def563)
2015-05-13 18:45:18 +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
8be0592107 merge branch 'backport' into nm-1-0
Backport a few bug fixes from master.

Also backport the valgrind suppression file and changes to platform's
'test-common.c'.
2015-05-13 16:09:28 +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
5b068e82e5 test: fix wrong use of memcmp() in nmtst_platform_ip4_routes_equal()
And nmtst_platform_ip6_routes_equal().

As already indicated by the comment, using memcmp() doesn't really work
here. It worked up to now, because the NMPlatformIP4Route structure has no
padding at the end.

If we would have a last 'guint8' member (as we will add later),
initializing an arry of routes on the stack would not clear the bytes
from the padding and the comparison using memcmp() would fail.

(cherry picked from commit d8d0c481b8)
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
2a8e698b76 valgrind: disable suppression for libnl
Not sure why (and whether!) this is really needed. Disable
it for now, resurrect it later if need be.

(cherry picked from commit bde42e78db)
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
c40e32c275 config: fix memleak of keyfile in finalize() of NMConfigData
Fixes: 9809eb4da1
2015-05-13 16:07:35 +02:00
Thomas Haller
272d2c83f1 valgrind: add libnl suppression
Add a comment about the upstream bug that fixes
the suppressed memleak in libnl.

Also, add a different backtrace for the same bug.
It currently doesn't hit easily, because we don't
call nl_msg_parse() often. In the future we will
though.

(cherry picked from commit 8e2ad8a3bd)
2015-05-13 16:07:35 +02:00
Thomas Haller
4ffc6f85c7 trivial: add comment to valgrind suppression file
(cherry picked from commit 815b436c0a)
2015-05-13 16:07:35 +02:00
Thomas Haller
f9ef0914b5 valgrind: add libnl suppression
Got this on F21, libnl 3.2.25-5.fc21

(cherry picked from commit 0731da16fa)
2015-05-13 16:07:35 +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
Piotr Drąg
c0917a075b po: update Polish (pl) translation (bgo #749164)
https://bugzilla.gnome.org/show_bug.cgi?id=749164
(cherry picked from commit 10d03ed5f5)
2015-05-12 13:06:51 +02:00
Dan Williams
5e7e59b040 build: correct help message about missing readline + termcap libraries
(cherry picked from commit 21fef6a357)
2015-05-11 10:33:51 -05: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
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