Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
2297333bb1 default-route: merge branch 'th/default-route-fixes-rh1205405'
Two improvements for handling default-routes.

https://bugzilla.redhat.com/show_bug.cgi?id=1224291
https://bugzilla.redhat.com/show_bug.cgi?id=1205405
2015-05-29 11:50:10 +02:00
Thomas Haller
d51975ed92 default-route: also configure default-routes for assumed connections
Previously for assumed connections we would never configure a default route.
That has serious problems for example in the following two scenarios:

  - the default-route might have a limited lifetime from a previous
    SLAAC/accept_ra setting. In this case, once we assume the connection
    we must also ensure that we extend the lifetime of the default
    route.
  - the gateway could be received via DHCP/RA and it might change.
    If we ignore default-routes for assumed connection we miss that
    change.

The problem is that the notion of "assumed connection" wrongly combines
two conflicting goals (related bug bgo#746440):
  a) have an external device that is entirely unmanged by NM.
  b) do a seamless takeover of a previously managed connection at start,
     but still fully manage.

This patch changes the handling of default-routes towards meaning b).

https://bugzilla.redhat.com/show_bug.cgi?id=1224291
2015-05-29 11:48:57 +02:00
Thomas Haller
98e50e358b default-route: for devices with 'never-default' enforce the default-route only once
Since da708059da, we would pickup the
default-route as configured externally, except at those moments when
NM re-applys the IP configuration of the interface, such as during a
DHCP lease.

That allows the user to add/remove the default-route externally (iproute).
But still, at random times (DHCP lease), we will revert those external
changes.

Extend this, that if the connection is explicitly configured as
'never-default=yes', that it tells NM not to interfere with externally
added default-routes on this device. That means, NM will only remove
any preexisting default-routes when configuring the device a first
time.
On any later attempts, NM will assume whatever is configured there.
That makes sense because the user indicated not wanting NM to
manage a default-route on that device, so if something externally
added a default-route, assume that is what the user wants.

This only affects non-assumed connections, with 'never-default=yes'.

https://bugzilla.redhat.com/show_bug.cgi?id=1205405
2015-05-29 11:45:48 +02:00
Thomas Haller
49227a07f3 default-route: add @out_is_never_default argument to has_default_route()
Also accept a NULL connection in
nm_default_route_manager_ip4_connection_has_default_route() and
nm_default_route_manager_ip6_connection_has_default_route().
2015-05-29 11:43:58 +02:00
Jiří Klimeš
242fe0bfb0 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.
2015-05-29 08:09:53 +02:00
Jiří Klimeš
91a5f4ceb9 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:04:26 +02:00
Jiří Klimeš
2c299ba65c 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:04:26 +02:00
Lubomir Rintel
c47c06470a builds: only enable TAP driver for glib >= 2.37.6
No TAP support for previous versions and --tap argument is silently ignored,
confusing the TAP driver.
2015-05-28 12:51:24 +02:00
Jiří Klimeš
a5e43ab510 nm-import-openvpn: import 'float' OpenVPN option
https://bugzilla.gnome.org/show_bug.cgi?id=737108

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2015-05-28 12:04:58 +02:00
Pavel Šimerda
cd3c52a24d build: support runstatedir configure option
https://bugzilla.gnome.org/show_bug.cgi?id=737139

[thaller@redhat.com: modified original patch]
2015-05-28 11:46:11 +02:00
Jiří Klimeš
98abf9dc30 merge: offer valid values for enum-style properties in nmcli (rh #1034126)
Values for enumeration-style properties are displayed when setting a property,
and also TAB-completion offers the values.

Later, we plan to improve the handling even more by adding meta-data to libnm.
That would enable offering yes/no values, for example.

https://bugzilla.redhat.com/show_bug.cgi?id=1034126
2015-05-28 10:14:09 +02:00
Jiří Klimeš
79bc271685 cli: TAB-completion for enum-style property values (rh #1034126)
Valid values for enumeration-style properties are offered in TAB-completion in
the editor. Thus the user has a quick overview of the possible values and can
edit properties more easily.

Example:
$ nmcli con edit type wifi
nmcli> set wifi-sec.group <TAB>
ccmp    tkip    wep104  wep40
nmcli> ...

https://bugzilla.redhat.com/show_bug.cgi?id=1034126
2015-05-28 10:13:52 +02:00
Jiří Klimeš
bf01da1a08 cli: add missing nmc_property_802_1X_allowed_eap() function 2015-05-28 10:13:52 +02:00
Jiří Klimeš
188d6cbaf3 cli: change function for allowed values to return array of strings 2015-05-28 10:13:51 +02:00
Jiří Klimeš
5e1a7ffb39 cli: add @brackets parameter to nmc_util_strv_for_display 2015-05-28 10:13:51 +02:00
Jiří Klimeš
db0f5b3b4c cli: print valid-values hint in property menu for empty "set" command
nmcli 802-11-wireless.mode> set
Allowed values for 'mode' property: infrastructure, adhoc, ap
Enter 'mode' value:
2015-05-28 10:13:51 +02:00
Jiří Klimeš
bfd502a9b1 core/cli: add missing device state-reason to string conversions
for NM_DEVICE_STATE_REASON_PARENT_CHANGED
and NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED

Fixes: cd3df12c8f
2015-05-27 11:11:47 +02:00
Jiří Klimeš
7fe250f51d device: log the device we were searching in udev 2015-05-27 10:07:57 +02:00
Dan Williams
6baca260d1 Partially revert "dhcp: gracefully recover from failed DHCP BOUND state transitions (bgo #743700)"
This reverts commit 7daf63461de4195b1626ca15f835fc7cbc56e847.

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:23:26 -05:00
Thomas Haller
fb623df747 ifnet/test: rename test check_ifnet to test-ifnet
All our other test binaries are named "test-*" so rename this
one too. Also we gitignore "test-*.log" files, but didn't ignore
"check_ifnet.log".
2015-05-26 16:35:00 +02:00
Jiří Klimeš
f46eb1fc20 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
2015-05-26 15:59:11 +02:00
Thomas Haller
ce3d1533cc test: fix running valgrind tests with NMTST_NO_VALGRIND
Fixes: 6463ce5dd9
2015-05-26 15:34:19 +02:00
Beniamino Galvani
90a7ad8dec ifnet/tests: convert to GLib test functions 2015-05-26 14:47:22 +02:00
Beniamino Galvani
fe765d30da ifnet/tests: fix GCC 5 warning about possible misuse of logical not
With GCC 5, -Wlogical-not-parentheses is enabled by -Wall and warns
about suspicious code like:

  int a;
  ...
  if (!a > 1) { ... }

Fix the following warning:

test_all.c: In function ‘test_is_static’:
test_all.c:114:32: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  ASSERT (!is_static_ip6 ("eth0") == TRUE, "is static",
                                  ^
2015-05-26 14:47:22 +02:00
Lubomir Rintel
4a4f703c94 libnm,dbus-helpers: include glib-compat for g_test_initialized() 2015-05-26 14:17:31 +02:00
Lubomir Rintel
defe992a10 merge: branch 'lr/tap-tests' (bgo #749375)
https://bugzilla.gnome.org/show_bug.cgi?id=749375
2015-05-26 13:52:54 +02:00
Lubomir Rintel
02e3d6c286 tests: don't try to connect to the private socket
Even if we're running the tests as root we still want to use the mock
service instead of whatever version of daemon runs on the test host.
2015-05-26 13:51:45 +02:00
Lubomir Rintel
dd959087a2 tests: be a bit more helpful when valgrind tests fail 2015-05-26 13:51:45 +02:00
Lubomir Rintel
6463ce5dd9 tests: use the TAP formatter
The test results in standard format are easily integrated into CI systems.
2015-05-26 13:51:45 +02:00
Lubomir Rintel
380ed63318 build: switch to parallel test harness
This will make it possible to use the TAP formatter.
2015-05-26 13:51:45 +02:00
Lubomir Rintel
14f4674f64 tests: call g_test_run() even when skipping the test
It will return the 77 exit code itself. For TAP output it will also generate
the proper test skip marker.
2015-05-26 13:51:44 +02:00
Lubomir Rintel
d0e25ac8be tests: always spawn private d-bus
Parallel test runs would not be possible without this.
2015-05-26 13:51:44 +02:00
Lubomir Rintel
f627d6db8e tests: move all asserts into tests
Otherwise the TAP formatter would produce a plan-less output.
2015-05-26 13:51:44 +02:00
Beniamino Galvani
a6f5aeeb28 dns: fall back to writing resolv.conf when other methods are not available
After commits:

de0d623680 dns: don't fall back to other methods when resolvconf or netconfig fail
e573977b80 dns: allow runtime selection of resolv.conf manager

the method used to write /etc/resolv.conf is specified by a
configuration parameter and NM doesn't try other methods if the chosen
one has not success.

Restore the fallback to the 'none' method if resolvconf or netconfig
executables are not available, so that when the value of 'rc-manager'
is misconfigured the system continues to work properly.

https://bugzilla.gnome.org/show_bug.cgi?id=749286
2015-05-26 13:33:47 +02:00
Cédric Valmary
58ed063c71 po: update Occitan (oc) translation (bgo #749754)
https://bugzilla.gnome.org/show_bug.cgi?id=749754
2015-05-25 11:58:22 +02:00
Thomas Haller
e0d103b1a2 test: include "nm-keyfile-internal.h" for tests under src/
Including "nm-keyfile-internal.h" before "nm-test-utils.h" enables
a few useful utilities. If we know that our test uses NetworkManagerUtils.h,
we can always include it -- as we have libnm-core available.
2015-05-20 19:03:47 +02:00
Thomas Haller
89c6abc7ab libnm/test: include "nm-keyfile-internal.h" in test-general.c
This enables special code in "nm-test-utils.h" that is useful
for tests.
2015-05-20 18:39:04 +02:00
Thomas Haller
a915b57876 libnm: fix libnm.ver by putting new symbols into appropriate section
Fixes: 019943bb5d
2015-05-20 15:01:11 +02:00
Thomas Haller
d43be83aaa libnm: enforce that "nm-utils-private.h" header is not used inside src/
Let "nm-utils-private.h" and "nm-types.h" conflict.
2015-05-20 12:42:19 +02:00
Thomas Haller
670ca44721 libnm: rename DNSOptionDesc and @dns_option_descs to have an "nm"-prefix
Declarations in header files should always have an "nm" related
prefix.

Fixes: 019943bb5d
2015-05-20 12:42:19 +02:00
Thomas Haller
533f9fa2d2 libnm: move internal dns-option helpers to "nm-core-internal.h"
"nm-utils-private.h" should not be used outside of libnm-core/.
core/ should only use public API or "nm-core-internal.h".

Also, "nm-setting-ip-config.h" is a public header and should
not contain internal defines. Move them to "nm-core-internal.h"
too.

Fixes: 019943bb5d
2015-05-20 12:42:14 +02:00
Dan Williams
e47eca8761 systemd: fix build with toolchains not exporting CLOCK_BOOTTIME
See 123322c6d6 for the NM-side fix.  We
need this too for the systemd code.
2015-05-19 16:02:28 -05:00
Dan Williams
c428935d9f merge: more isolated pieces of dcbw/devices-for-all (bgo #749401) 2015-05-19 09:28:25 -05:00
Dan Williams
2a7a19e767 core: rearrange some VLAN code and clean up dispose()
Move parent-related stuff before its callers and clean up dispose
so that we no longer need priv->disposed.
2015-05-19 09:25:16 -05:00
Dan Williams
5cf226463a platform: move InfiniBand property reading into the platform and prefer netlink
Add a netlink implementation for reading InfiniBand properties, but fall back to
sysfs when that isn't supported by the kernel.
2015-05-19 09:25:16 -05:00
Dan Williams
d4e0a1e8cc core: earlier software capability detection
We need to know whether we can create interfaces of any given
NMDevice subclass or not.  So don't rely on just the NMPlatformLink
for that information, because we won't have a platform link for
software devices before we create them.
2015-05-19 09:25:16 -05:00
Dan Williams
81db512997 core: check duplicate devices by interface name not UDI
We can't have devices with duplicate interface names so we might
as well use that for dupe checking instead of the (mostly useless)
UDI.
2015-05-19 09:25:16 -05:00
Thomas Haller
652853e0d0 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>
2015-05-19 15:34:41 +02:00
Thomas Haller
5b04fde302 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.
2015-05-19 15:29:20 +02:00
Jiří Klimeš
08fbe75edd libnm: fix nm_vpn_plugin_old_set_connection() for connection == NULL 2015-05-19 14:48:37 +02:00