Commit graph

12257 commits

Author SHA1 Message Date
Beniamino Galvani
c41fe4c659 dhcp: detect NMIP4Config 'metered' flag based on ANDROID_METERED DHCP option
Some versions of Android's DHCP server send option 43 (Vendor specific
information) with value "ANDROID_METERED" in Wi-Fi hotspot mode.

Mark the NMIP4Config as metered when such option is received.

(cherry picked from commit 1e39b2320d)
2015-07-22 13:52:46 +02:00
Beniamino Galvani
75f0c79494 systemd/dhcp: add support for vendor specific DHCP option
This adds support for DHCP option 43 (Vendor Specific Information) to
the internal DHCP client. The option carries an opaque object of n
octets, interpreted by vendor-specific code on the clients and
servers.

(cherry picked from commit 3c2f4a17f9)
2015-07-22 13:52:46 +02:00
Beniamino Galvani
54ebd11026 core: add 'metered' flag to NMIP4Config
Some DHCP servers send specific options to give a hint that clients
should avoid unneeded data usage.

Add a metered flag to NMIP4Config to keep track of this information.

(cherry picked from commit 68db65b727)
2015-07-22 13:52:46 +02:00
Beniamino Galvani
a4cdf4a63c cli: add support for 'metered' connection property
(cherry picked from commit f0aebfd746)
2015-07-22 13:52:46 +02:00
Beniamino Galvani
5496a91575 cli: add nmc_string_to_tristate()
(cherry picked from commit 609f4f37c0)
2015-07-22 13:52:45 +02:00
Beniamino Galvani
4eb05767ee libnm-core: add 'metered' property to NMSettingConnection
Add a 'metered' enum property to NMSettingConnection with possible
values: unknown,yes,no. The value indicates the presence of limitations
in the amount of traffic flowing through the connection.

(cherry picked from commit 6f647fe689)
2015-07-22 13:52:45 +02:00
Beniamino Galvani
e16c068289 cli: add 'metered' property to device
(cherry picked from commit f208e7030f)
2015-07-22 13:52:45 +02:00
Beniamino Galvani
77a7e913a2 core,libnm: add 'metered' property to NMDevice
(cherry picked from commit bbbf522941)
2015-07-22 13:52:45 +02:00
Beniamino Galvani
1fa10e9766 build: add NM_AVAILABLE_IN_1_0_6 define 2015-07-22 13:49:31 +02:00
Tore Anderson
f42d3d9950 device: prefer wifi over wwan by default
This makes wifi preferred to wwan (the modem and bluetooth device types
to be specific) by default, so that users that care about being
connected at all times can keep both enabled with auto-connect. As wifi
is usually unmetered and often faster than wwan, it makes sense to
prefer it. This is also how pretty much every smart-phone in the world
behaves, so it aligns better with user expectations too.

https://bugzilla.gnome.org/show_bug.cgi?id=744754
(cherry picked from commit 3efb6740fc)
2015-07-22 10:52:13 +02:00
Jiří Klimeš
439ff3841d cli: fix verifying flag-based properties (rh #1244048)
Some of the properties changed from GParamSpecUInt to GParamSpecFlags, namely
NM_SETTING_VLAN_FLAGS
NM_SETTING_DCB_APP_FCOE_FLAGS
NM_SETTING_DCB_APP_ISCSI_FLAGS
NM_SETTING_DCB_APP_FIP_FLAGS
NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS
NM_SETTING_DCB_PRIORITY_GROUP_FLAGS

(commit fcfb4b40ba)

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

(cherry picked from commit 94b1b53a91)
2015-07-17 11:51:20 +02:00
Jiří Klimeš
3af6be7aa6 docs: fix a copy/paste error in description of VLAN flags
(cherry picked from commit 2af10ef444)
2015-07-17 11:50:42 +02:00
Dan Williams
79e71ee832 merge: vpn: delay quitting when a new secrets request comes in (bgo #752237)
https://bugzilla.gnome.org/show_bug.cgi?id=752237
2015-07-16 16:53:04 -05:00
Dan Williams
774170016b libnm/libnm-glib: don't quit in the middle of asking for secrets (bgo #752237)
If the VPN plugin terminated and the user started it again, then the
quit timer will still be running and it sometimes happens that the
VPN plugin will quit while the UI is asking the user for secrets.
That's not very nice, so don't do that.

Reproducer: while connect to the VPN, suspend your laptop.  Then
resume it, and immediately re-start the VPN connection.  Watch the
secrets dialog disappear within a very short time.

https://bugzilla.gnome.org/show_bug.cgi?id=752237
2015-07-16 16:52:48 -05:00
Dan Williams
d22a2a3165 libnm/libnm-glib: clean up VPN plugin timeouts
Use nm_clear_g_source().
2015-07-16 16:52:48 -05:00
Thomas Haller
1e102bccdd connectivity: log warning when using https:// URI
https://bugzilla.gnome.org/show_bug.cgi?id=747866
(cherry picked from commit eab32a5252)
2015-07-16 17:11:04 +02:00
Dan Williams
171b54b11c connectivity: explicitly check for 511/Network Authentication Required (RFC6585) (bgo #670394)
If the response affirmatively indicates you're behind a portal, we might as well
use that information.

https://bugzilla.gnome.org/show_bug.cgi?id=670394
(cherry picked from commit 6a81daf1cb)
2015-07-16 17:11:02 +02:00
Thomas Haller
5316d4dec7 config/rpm: use plain HTTP URI for connectivity checking
https://bugzilla.gnome.org/show_bug.cgi?id=747866
(cherry picked from commit 2a3a4eb16f)
2015-07-16 16:52:56 +02:00
David Shea
bfb6c78430 libnm: handle illegal characters in nm_utils_ssid_to_utf8() (rh #1243078)
g_convert_with_fallback() will fail if the SSID contains characters that
are not legal in the source encoding, which, if $LANG is not set, will
be ASCII. If this happens, replace all non-ASCII and non-printable
characters with '?'. It is possible that nm_utils_ssid_to_utf8() will
now return an empty string (e.g., the source string is actually
big-endian UTF-16 and g_strcanon() stops on the first byte), but it will
not return NULL.

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

(cherry picked from commit 568b4ad31f)
2015-07-16 14:24:47 +02:00
Lubomir Rintel
a24f089728 build: fix comment for NM_MORE_LOGGING
Reported-by: Michael Biebl <biebl@debian.org>
(cherry picked from commit 924117c144)
2015-07-15 11:04:40 +02:00
Thomas Haller
a51a95b7b3 build/trivial: move declaration of NM_AVAILABLE_IN_0_9_10 macro
Move the declaration of the macro to make it more similar to the
version file on master.
2015-07-15 10:41:27 +02:00
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