Commit graph

12236 commits

Author SHA1 Message Date
Thomas Haller
c27385b401 build: add NM_VERSION_1_0_6 macro and bump NM_VERSION_CUR_STABLE 2015-07-15 10:36:45 +02:00
Dan Horák
13320ba35c contrib/rpm: WEXT depends on enabled wifi
(cherry picked from commit 97cf6e47dd)
2015-07-14 19:03:10 +02:00
Lubomir Rintel
a54618e722 release: bump version to 1.0.5 (development) 2015-07-14 18:47:18 +02:00
Lubomir Rintel
f27429138f release: bump version to 1.0.4 2015-07-14 18:38:05 +02:00
Thomas Haller
eb4f8dd278 route-manager: merge branch 'th/route-full-sync'
Fix route manager not to delete externally added routes
but only routes that were previously added by route manager.

Also, add a test case and refactor the _exists() functions
to have them more useful.

(cherry picked from commit 5cc2eabe5d)
2015-07-14 13:45:27 +02:00
Thomas Haller
3cbc8981d6 route-manager/test: add test for full-sync
(cherry picked from commit ae721e7f0a)
2015-07-14 13:44:57 +02:00
Thomas Haller
ba44a92f52 test: add nmtst_platform_ip4_route() utils
(cherry picked from commit cf4b1a0c3d)
2015-07-14 13:44:57 +02:00
Thomas Haller
642c38b26b platform: replace addr/route exists() functions by get()
Rename exists() functions to get() and return the cached platform
object.

(cherry picked from commit 6f8fcd2f47)
2015-07-14 13:44:57 +02:00
Thomas Haller
cf7529b66c route-manager: align trace logging statement
(cherry picked from commit 7bda970928)
2015-07-14 13:44:57 +02:00
Thomas Haller
150dd2adc6 routes: fix race syncing routes by not doing full-sync
In most cases, when syncing routes, we should only remove routes
that were configured by us previously. Otherwise, there is a race
that we can remove routes added externally.

Now, when applying IP configuration for a device, only do a full-sync
at the first time when we activate the device. Later on, only remove
routes that were added by us.

(cherry picked from commit 8b015826e6)
2015-07-14 13:44:57 +02:00
Thomas Haller
49a7418d33 routes/trival: add argument @routes_full_sync to IP config commit
The argument is still unused, so no behavioral change yet.

(cherry picked from commit 6124f5b94a)
2015-07-14 13:44:56 +02:00
Thomas Haller
b159b668b3 route-manager: add argument to to only remove routes that were added by NMRouteManager
Add an argument @full_sync to the sync method of NMRouteManager.
@full_sync was what we did up to now, meaning, we removed every
route on the interface that was no on our internal list of known
routes.

Now with !@full_sync, only remove routes that were tracked previously.
This means, we will only remove routes that were added by us previously.

Don't make use of the new option yet. So there is no change of behavior
yet.

(cherry picked from commit 65f2090cc2)
2015-07-14 13:44:56 +02:00
Thomas Haller
de0f893c14 route-manager/trivial: fix naming of local variable
(cherry picked from commit b9bc960e97)
2015-07-14 13:44:56 +02:00
Lubomir Rintel
bc82f6f690 vpn-plugin-old,dispatcher: cast unchecked g_variant_lookup() calls to void
This is done to silence coverity. In the dispatcher the existence of the
key is checked before and we're fine with leaving the value untouched
in the vpn-plugin-old.

(cherry picked from commit a9996c4f1d)
2015-07-14 13:19:28 +02:00
Lubomir Rintel
a051446492 linux-platform: correct the lifetime conditional
Coverity detected that it was always-true:
src/platform/nm-linux-platform.c:4035: dead_error_line: Execution cannot reach the expression "preferred != 0U" inside this statement: "if (lifetime != 0U || lifet...".

(cherry picked from commit da612acc6a)
2015-07-14 13:19:28 +02:00
Lubomir Rintel
57b4de25ea config: fix a potential NULL dereference
Coverity:
src/nm-config.c:598: var_deref_op: Dereferencing null pointer "groups".

(cherry picked from commit 421cf84343)
2015-07-14 13:19:28 +02:00
Jiří Klimeš
0885e561b3 updated NEWS 2015-07-14 12:42:21 +02:00
Jiří Klimeš
09124682ba vpn: send firewall zone to firewalld also for VPN connections (rh #1065948)
https://bugzilla.redhat.com/show_bug.cgi?id=1065948
https://bugzilla.redhat.com/show_bug.cgi?id=1238124

(cherry picked from commit a418750f07)
2015-07-14 12:28:44 +02:00
Lubomir Rintel
f90e1549ae platform: don't assert there's no parent-parent loops
http://www.spinics.net/lists/netdev/msg314907.html
(cherry picked from commit 4aac263b0d)
2015-07-14 11:52:01 +02:00
Thomas Haller
38bf2cb0e2 vpn: allow overwriting default gateway by connection configuration
It is wrong to only consider internal_gateway of the VPN connection.
Instead, we must first set the gateway of NMIP4Config and then overwrite
it with the connection settings.

(cherry picked from commit 691ebbdc43)
2015-07-13 15:46:34 +02:00
Thomas Haller
81945215c6 vpn: fix overwriting gateway of parent device for non-tunnel based VPNs
For non-tunnel based VPNs (openswan, libreswan), we must
clear the gateway setting. The default route is managed
by NMDefaultRouteManager, and we must not overwrite the
gateway of the parent device.
This fixes a bug if the VPN connection specifies a gateway, it
would have overwritten the gateway of the underlying device.

(cherry picked from commit 1465c1d326)
2015-07-13 15:45:46 +02:00
Thomas Haller
44c6296cae vpn: don't set the gateway of VPN's IP config to the external gateway
The gateway property of NMIP4Config/IP6Config determines the next hop
for the default route. That is different from the @external_gw property
of the VPN which is the address of the world-reachable VPN gateway.

It is wrong to set the gateway of the VPN's IP config to the external gateway.
This causes ip4_config_merge_and_apply() to overwrite the gateway of the
underlying device.

Instead, NMDefaultRouteManger gets the gateway directly from the VPN
connection by quering nm_vpn_connection_get_ip4_internal_gateway().

(cherry picked from commit 5cd1316100)
2015-07-13 15:45:46 +02:00
Thomas Haller
8cda578fe2 default-route-manager: fix handling for absent default routes for VPN
When a VPN has no default route, it is wrong to enforce the absence
of a default route on that device. Instead, if there is no default
route, NMDefaultRouteManager should just forget about the route.

This is especially important, because for VPN types like openswan
there is no distinct tunnel interface. Instead, it shares the ifindex
with the parent-device.
Note that devices usually only enforce their default-route for a short
time and afterwards switch to non-synced. If that happens and there
is a VPN that enforces the absense of the default route on that device,
we end up deleting the default route.

(cherry picked from commit 16d0850c37)
2015-07-13 15:45:46 +02:00
Thomas Haller
ac8a90d3aa default-route-manager: don't add entries with (!synced && never_default)
Entries with (!synced && never_default) make no sense. Don't add them
to the list of tracked entires.

(cherry picked from commit befb36691a)
2015-07-13 15:45:46 +02:00
Lubomir Rintel
a8dd15d745 device: turn off "unmanaged unless IFF_UP externally" for veth
We currently don't manage a veth inside a container despite we should because
it's an externally configured software interface and thus waits for IFF_UP.

Given veths are prevented from being managed outside of a container by an udev
rule anyway it's safe to lift the external IFF_UP requirement for them.

(cherry picked from commit bcc79cc0eb)
2015-07-12 15:03:07 +02:00
Lubomir Rintel
cde17da19b device: move the decision whether to wait for IFF_UP a virtual function
We'd like to override it for veths.

(cherry picked from commit adb6e9afb1)
2015-07-12 15:02:46 +02:00
Jiří Klimeš
86f1645d88 clients: fix bad array loop in nm-secret-agent-simple.c:strv_has (bgo #752137)
https://bugzilla.gnome.org/show_bug.cgi?id=752137

(cherry picked from commit 55c3f70ec8)
2015-07-10 12:43:45 +02:00
Piotr Drąg
3723354ec8 po: update Polish (pl) translation (bgo #751998)
https://bugzilla.gnome.org/show_bug.cgi?id=751998

(cherry picked from commit 66e2c29346)
2015-07-10 12:26:16 +02:00
Thomas Haller
0eef608cd1 device: fix regression for ignored search domains in ip._config_merge_and_apply()
Reported-by: Fabrice Bellet <fabrice@bellet.info>
Fixes: 2a5eea7e76

https://bugzilla.gnome.org/show_bug.cgi?id=752193
(cherry picked from commit d6831efc6b)
2015-07-09 23:16:52 +02:00
Lubomir Rintel
6f6a8a85c9 contrib/rpm: always drag in bluez-libs-devel
We don't really know which version it's going to be -- and thus if we're going
to actually need it (version 5), or not (version 4). It's going to be decided
at configure time.

Also, drop the bogus Fedora 19 conditionals; Fedora < 20 has ModemManager that's
too old for the WWAN code anyway.

(cherry picked from commit db44539912)
2015-07-09 18:11:52 +02:00
Lubomir Rintel
8455d42684 bluetooth: avoid an assertion failure if built w/o bluez5 support
Fail with a proper error if we built without Bluez 5 support, but detect it at
runtime.

(cherry picked from commit f44ac46485)
2015-07-09 18:11:52 +02:00
Jiří Klimeš
c73eeb39f5 supplicant: allow with_system_ca_path to be a file name (rh #1236548)
NetworkManager uses wpa_supplicant, which in turn calls OpenSSL for verifying
certificates. wpa_supplicant calls
SSL_CTX_load_verify_locations(ctx, CAfile, CApath)
using its ca_cert and ca_path options as CAfile and CApath parameters.

We have a configure time option with_system_ca_path to override ca_path.
However, it doesn't work when a system (like Fedora) only uses bundled PEM
certificates instead of a directory with hashed certificates ([1], [2]).

So this commit allows setting --with_system_ca_path to a file name (the
trusted certificate bundle). Then the name is used to populate wpa_supplicant's
ca_cert instead of ca_path.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1053882
[2] https://www.happyassassin.net/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/

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

(cherry picked from commit 640eb8f284)
2015-07-08 17:12:19 +02:00
Jiří Klimeš
1111b867ce utils: fix error logging in ASSERT_VALID_PATH_COMPONENT()
(cherry picked from commit 43a50fd5f2)
2015-07-08 16:55:56 +02:00
Jiří Klimeš
65a585beba device: use NULL instead of 0 in g_return_val_if_fail() for pointer
(cherry picked from commit 46f29a4abc)
2015-07-08 16:55:52 +02:00
Jiří Klimeš
61b4bec803 device: trivial: fix a copy/paste error in comment
(cherry picked from commit dce050a45d)
2015-07-08 16:55:48 +02:00
Thomas Haller
0d0fa7ead6 route-manager: restore shadowed gateway routes after direct routes
(cherry picked from commit ce2964c021)
2015-07-08 12:01:53 +02:00
Jiří Klimeš
292f0105b2 device: just get ip_iface in the place where it is needed
priv->iface could change in device_link_changed() which reacts on platform link
changes caused by nm_platform_link_set_user_ipv6ll_enabled(). (The variable could
change between obtaining and using its value, because emitting a glib signal runs
callbacks synchronously).

Actually, the problem is already fixed by commit 04caae735f.
But still this is better.

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

(cherry picked from commit bb1692707f)
2015-07-07 18:53:21 +02:00
Thomas Haller
e3bd4e1d44 route-manager/trivial: move code
Have related functions closer together.

Fixes: 635eea60cf
(cherry picked from commit ce9d8e0817)
2015-07-07 17:29:47 +02:00
Thomas Haller
ca861152b5 settings: get_plugin() should return plugin that has all requested capabilities
This bug had no real consequences because we only called
get_plugin() with one capability at a time.

(cherry picked from commit 08b99eea10)
2015-07-07 17:22:15 +02:00
Thomas Haller
a1df05662a route-manager/logging: fix wording in logging statement
(cherry picked from commit 80a0ec76b9)
2015-07-07 16:33:45 +02:00
Thomas Haller
3562e600fb route-manager: merge branch 'th/direct-route-conflict-bgo752062'
https://bugzilla.gnome.org/show_bug.cgi?id=752062

(cherry picked from commit ad2809cf6a)
2015-07-07 16:32:30 +02:00
Thomas Haller
cce7884fe6 route-manager: always add conflicting direct routes and bump the route-metric if necessary
Kernel does not allow to add the same route (as determined by network/plen,metric)
on two different interfaces (ifindex). In case of conflict, NMRouteManager used to
ignore any but the firstly added route.

On the other hand, we cannot add a gateway-route, if there is no direct
route to the gateway. Hence, skipping duplicate routes can mean that we
skip a direct route what was necessary to add another gateway-route,
which then leads to a failure to add that route.

This also applies to IPv4 device routes that since recently are managed
by NMRouteManager.

For example, say you connect two interfaces to the same IP subnet.
The route-metric can conflict if the interfaces are of the same type
or if the user explicitly configured a conflict.
In case of conflicts, NMRouteManager would only configure the first
appearing route and skip the shadowed route on the second interface.
Now we cannot configure gateway-routes on the second interface because
the gateway is unreachable.

There are many scenarios where this issue can happen, especially with
default-routes and user-configured-routes.
For example with default-routes, ip4_config_merge_and_apply() would check
if the default-gateway requires an explict route and possibly add it.
But then NMRouteManager might not add the route because it is shadowed
by a route on an other interface.

This patch solves the issue by having NMRouteManager configure shadowed
routes too, similar to what NMDefaultRouteManager does.
It does that by searching for an unused, non-conflicting, higher metric
for the route, i.e. bump the metric by 1 until we can add it without
conflict.

Also note that NMRouteManager still ensures that for conflicting routes
the best route sticks to the interface that configured it first. That
means if you later add the conflicting route on another interface, it
will be added with higher metric and the data is still routed along the
first interface.

(cherry picked from commit f5c087c8e9)
2015-07-07 16:31:50 +02:00
Thomas Haller
7a0ec8c8ff route-manager: add optional @r2_metric argument to _route_equals_ignoring_ifindex()
(cherry picked from commit 700bb96523)
2015-07-07 16:30:38 +02:00
Thomas Haller
abebc340cc platform: add optional @metric argument to route_add() function
Allow overwriting the route metric.

(cherry picked from commit 09fdf58f4d)
2015-07-07 16:30:38 +02:00
Thomas Haller
29f3432d01 route-manager: add compare function for route-destination
(cherry picked from commit 635eea60cf)
2015-07-07 16:30:38 +02:00
Thomas Haller
b3c41f4829 route-manager: fix trace logging statement
(cherry picked from commit 0055a7dd74)
2015-07-07 16:30:38 +02:00
Thomas Haller
cf15f2a4a8 config: merge branch 'th/nm-config-intern-bgo750558' (early part)
Early part of fixes and improvements to NMConfig.

This is mostly refactoring and adding of new utility functions.

But it also fixes the way how to parse configuration options from
"NetworkManager.conf" keyfile. So this brings behavioral changes
in the way how we parse the configuration. But unless the user had
unusual configurations (whitespaces, backslash escapes), there should
be no visible changes.

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

(cherry picked from commit 65753dbc13)
2015-07-03 09:24:05 +02:00
Thomas Haller
500f590033 config: only handle 'option+' and 'option-' keys for known settings
It is wrong to blindly merge keys that have an 'option+' or 'option-'.
Merging options is only possibly when we understand what the option
means and how to merge it.

No longer handle every setting but only those that are explicitly known
to be string-lists (or device-specs).

(cherry picked from commit a1ea678f78)
2015-07-03 09:24:05 +02:00
Thomas Haller
e896817d80 core: add nm_match_spec_join() function
We have a special implemenation nm_match_spec_split() to split
a string. We also need the reverse operation to be able to convert
a list of specs to string without loss.

(cherry picked from commit bd57d76af8)
2015-07-03 09:24:05 +02:00
Thomas Haller
0cbcf21e80 libnm: add @deep_copy argument to _nm_utils_strv_to_slist() and _nm_utils_slist_to_strv()
(cherry picked from commit ed632207cd)
2015-07-03 09:24:05 +02:00