Commit Graph

21088 Commits

Author SHA1 Message Date
Francesco Giudici
d7f3c79881 doc: fix describe message for team link watchers 2018-01-22 19:21:42 +01:00
Francesco Giudici
ff16252a71 nmcli: clear link-watchers before adding the new ones we want to set 2018-01-22 19:21:42 +01:00
Francesco Giudici
381c1a19b6 libnm-core: ensure alignment of team.config and other team properties
https://bugzilla.redhat.com/show_bug.cgi?id=1533830
2018-01-22 19:16:09 +01:00
Thomas Haller
14cfb3d373 wifi/iwd: merge branch 'pr/60'
https://github.com/NetworkManager/NetworkManager/pull/60
2018-01-22 15:58:13 +01:00
Andrew Zaborowski
c95c27a099 iwd: Wait for disconnect to finish
In a previous patch I added deactivate_async to make sure that NM
auto re-connect waits for the IWD state to changed from "disconnecting"
to "disconnected" before starting a new activation when the user wants
to switch from one profile to another.  This doesn't account for when
IWD itself goes into "disconnecting" because of a connect failure.

When IWD goes into the "disconnecting" state we call
  nm_device_state_changed (NM_DEVICE_STATE_FAILED,
                           NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT)
immediately to give feedback to user as soon as possible.  We will
return FALSE from get_autoconnect_allowed for the period the
"disconnecting" state.
2018-01-22 15:43:30 +01:00
Andrew Zaborowski
bcf3b10284 iwd: Initialize priv->scanning when DBus interface appears 2018-01-22 14:53:20 +01:00
Andrew Zaborowski
e6689154ae iwd: use connection.auth-retries to handle authentication retries
Repeat commit 72756994d4 for NMDeviceIwd.
2018-01-22 14:53:20 +01:00
Andrew Zaborowski
d0c1e1a62a iwd: Implement deactivate_async
Deactivating the connection translates to a Device.Disconnect dbus call
to IWD.  The dbus call normally returns immediately because the
corresponding nl80211 command returns immediately but we can't rely on
that.  Make sure that NMDevice waits for the IWD method return before
continuing with the new activation request when switching wifi networks.
2018-01-22 14:53:20 +01:00
Andrew Zaborowski
a4f9d117d5 iwd: Improve Device.State property change handling
The handler would until now check if nm_device_is_activating() was true
or the NMDevice state was "activated" to decide whether to report to
NMDevice that we'd been unexpectedly disconnected (i.e. connection
failed).  However NM's "prepare" and "need auth" states correspond to
IWD's "disconnected" state because they don't involve Wifi
authentication/association.

Additionally nm_device_is_activating() returns TRUE even when NMDevice
state is "disconnected" but an activation request is pending.  As a
result when switching networks, NMDevice would first save the activation
request and go into the "disconnected" state, we'd then call the IWD's
Disconnect method and when we received the IWD state change notification
to "disconnected", we'd cause the pending activation request to be
considered a failure.  The handler shouldn't report a failed
connection when the NMDevice state is "disconnected".
2018-01-22 14:53:20 +01:00
Beniamino Galvani
a0cf466482 wifi: enable WPA-*-SHA256 AKMs only when the supplicant supports them
Commit 87ec5e90fe ("supplicant: set key_mgmt independent of pmf
value") enabled WPA-PSK-SHA256 or WPA-EAP-SHA256 even when the
supplicant didn't support them, potentially causing connection
failures.  Instead, use the 'pmf' capability to detect when they can
be enabled.

Fixes: 87ec5e90fe

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00096.html
2018-01-22 08:38:28 +01:00
Thomas Haller
dd2d55ca57 tests: fix test setup after requiring glib 2.40
Also, g_test_expect_message() no longer needs to suppress
deprecation warnings.

Fixes: 8a46b25cfa
2018-01-22 08:31:00 +01:00
Beniamino Galvani
22f32a16f5 device: skip IP configuration phase for external devices
We already avoid committing the IP configuration for external devices
(see commit 60334a2893). However, we still start DHCP/IPv6-autoconf
and, especially, we change sysctl values of the device.

To be sure that no action is taken on the device, return early from
the IP configuration phase, as in the method=disabled/ignore case.

https://bugzilla.redhat.com/show_bug.cgi?id=1530288
2018-01-19 14:10:01 +01:00
Beniamino Galvani
156344b8be device: increase carrier wait time to 6 seconds
Some NICs need longer to establish the link, increase the timeout from
5 to 6 seconds.

https://bugzilla.redhat.com/show_bug.cgi?id=1520826
2018-01-18 15:26:34 +01:00
Lubomir Rintel
d50e8d3ec1 connection: treat connection type's ability to have slaves uniformly
This also adds OVS_BRIDGE and OVS_PORT to places that didn't consider
them to be master types
2018-01-18 13:28:12 +01:00
Lubomir Rintel
1440fe6a88 ifcfg: don't forget master of ovs interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1519179
2018-01-18 13:28:12 +01:00
Lubomir Rintel
f70c1f717a ifcfg-rh/trivial: fix cosmetic issues
A typo and bad whitespace while at it.
2018-01-18 13:28:12 +01:00
Lubomir Rintel
8a46b25cfa all: require glib 2.40
RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-18 11:45:36 +01:00
Lubomir Rintel
1443bf77e8 all: require jansson 2.5
It was released Sep 19 2013 and Ubuntu 14.04 LTS (trusty) ships it.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-18 11:45:24 +01:00
Pavel Šimerda
c4f655579c libnm: fix empty statements that were supposed to return NULL
Discovered thanks to `-Wunused-value` when building on openSUSE Leap 42.3.
2018-01-17 19:20:03 +01:00
Thomas Haller
f2aa286fa9 libnm: cast guint32 argument to guint in variadic g_object_set()
yes, this is not an issue in practice. Variadic arguments are always
propagated to at least int/unsigned type. And kernel and glib both require
sizeof(guint32) <= sizeof(guint). Hence, this was safe on any supported
architecture. Still, let's be explicit about the types.
2018-01-17 10:17:31 +01:00
Thomas Haller
3c6cc7c2e0 wifi: merge branch 'wifi-fils'
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00073.html
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00065.html
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00083.html
2018-01-16 15:04:28 +01:00
Masashi Honma
0109615c4e supplicant: enable FILS only when wpa_supplicant supports it
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:59 +01:00
Masashi Honma
7711d7c87b cli: add support for FILS
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:59 +01:00
Masashi Honma
c7d490cfba ifcfg-rh/tests: add Wi-Fi FILS test
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:59 +01:00
Masashi Honma
6e742693ee supplicant/tests: add FILS test
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:59 +01:00
Masashi Honma
b4bbe5179f wifi: add support for FILS
The FILS(Fast Initial Link Setup) is a specification defined by IEEE 802.11ai to
speed up roaming. This patch adds support of it.

I have tested with these cases.
+-----+-------------------------+----------------+
| STA |            AP           |                |
|FILS |         key-mgmt        |     result     |
+-----+-------------------------+----------------+
|  1  | WPA-EAP                 |       O        |
+-----+-------------------------+----------------+
|  1  | WPA-EAP-SHA256          |       O        |
+-----+-------------------------+----------------+
|  1  | FILS-SHA256             |       X        |
+-----+-------------------------+----------------+
|  1  | FILS-SHA384             |       X        |
+-----+-------------------------+----------------+
|  1  | WPA-EAP WPA-EAP-SHA256  |       O        |
|     | FILS-SHA256 FILS-SHA384 | WPA-EAP-SHA256 |
+-----+-------------------------+----------------+
|  2  | WPA-EAP                 |       O        |
+-----+-------------------------+----------------+
|  2  | WPA-EAP-SHA256          |       O        |
+-----+-------------------------+----------------+
|  2  | FILS-SHA256             |       O        |
+-----+-------------------------+----------------+
|  2  | FILS-SHA384             |       O        |
+-----+-------------------------+----------------+
|  2  | WPA-EAP WPA-EAP-SHA256  |       O        |
|     | FILS-SHA256 FILS-SHA384 | FILS-SHA384    |
+-----+-------------------------+----------------+
|  3  | WPA-EAP                 |       X        |
+-----+-------------------------+----------------+
|  3  | WPA-EAP-SHA256          |       X        |
+-----+-------------------------+----------------+
|  3  | FILS-SHA256             |       O        |
+-----+-------------------------+----------------+
|  3  | FILS-SHA384             |       O        |
+-----+-------------------------+----------------+
|  3  | WPA-EAP WPA-EAP-SHA256  |       O        |
|     | FILS-SHA256 FILS-SHA384 | FILS-SHA384    |
+-----+-------------------------+----------------+

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:59 +01:00
Masashi Honma
87ec5e90fe supplicant: set key_mgmt independent of pmf value
Previouslly, the value of ieee80211w and key_mgmt field in
wpa_supplicant.conf was defined by the value of pmf.

NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE
  ieee80211w=0
  key_mgmt=wpa-eap
NM_SETTING_WIRELESS_SECURITY_PMF_OPTIONAL
  ieee80211w=1
  key_mgmt=wpa-eap wpa-eap-sha256
NM_SETTING_WIRELESS_SECURITY_PMF_REQUIRED
  ieee80211w=2
  key_mgmt=wpa-eap-sha256

Though these works, these does not include whole combinations.
The key_mgmt could be set independent of ieee80211w value.
For example, management frame protection could be used with
wpa-eap.
  ieee80211w=2
  key_mgmt=wpa-eap

And wpa-eap-sha256 could be used without management frame
protection.
  ieee80211w=0
  key_mgmt=wpa-eap-sha256

So this patch uses always key_mgmt=wpa-psk wpa-psk-sha256 or
key_mgmt=wpa-eap wpa-eap-sha256. By this setting, when AP
supports both, stronger algorithm will be chosen (ex. when AP
supports both wpa-eap and wpa-eap-sha256, wpa-eap-sha256 will be
chosen).

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2018-01-16 15:01:35 +01:00
Thomas Haller
0839adc7d7 libnm: merge branch 'th/libnm-jansson' (part 1)
https://github.com/NetworkManager/NetworkManager/pull/56
2018-01-16 14:48:47 +01:00
Thomas Haller
84576ce861 libnm: cleanup include in "libnm-core/nm-json.c"
We already define _GNU_SOURCE in "config.h", depending
on configure checks.

Also, we always should first include "config.h" (which means
to first include "nm-default.h").

Also, we don't need the entire <link.h>, <dlfcn.h> suffices.
2018-01-16 14:47:24 +01:00
Thomas Haller
e5f3c0fc8a libnm: only include "nm-jansson.h" from "nm-json.h"
"nm-utils/nm-jansson.h" and thus <jansson.h> must be included only
after "nm-json.h". Enforce that by never including them directly,
except from "nm-json.h" itself.
2018-01-16 14:47:24 +01:00
Thomas Haller
ee56c9250f libnm: add include guard to nm-json.h 2018-01-16 14:47:24 +01:00
Thomas Haller
2888778480 libnm: fix spelling for NM_JAONSSON_C define 2018-01-16 14:47:24 +01:00
Thomas Haller
b6b6baa773 libnm: rename "libnm-core/nm-jansson.h" to "libnm-core/nm-json.h"
We already have "shared/nm-utils/nm-jansson.h". Avoid reusing the same file name.
2018-01-16 14:47:24 +01:00
Thomas Haller
950a14128b libnm/trivial: don't use non-leading tabs 2018-01-16 14:47:24 +01:00
Thomas Haller
e5358606ba libnm: merge branch 'th/libnm-vpn-service-shutdown'
https://github.com/NetworkManager/NetworkManager/pull/59
2018-01-16 14:41:39 +01:00
Thomas Haller
e428252935 libnm: add nm_vpn_service_plugin_shutdown() API
Otherwise, the only way to disconnect the NMVpnServicePlugin
instance is by completely unrefing it. However, often it is
not so easy to ensure that nobody else is still keeping the
instance alive, after the point where we no longer want to
handle D-Bus requests. nm_vpn_service_plugin_shutdown() to the
rescue.
2018-01-16 14:39:09 +01:00
Thomas Haller
e89e5edcf8 libnm: cleanup resource handling in NMVpnServicePlugin:init_sync() 2018-01-16 14:38:06 +01:00
Lubomir Rintel
8ba46ff4c6 rpm: disable libnm-glib for Fedora 29 and RHEL 8
While at it, move the API documentation to libnm-devel.
There doesn't seem to be a better place for it.
2018-01-16 12:15:51 +01:00
Lubomir Rintel
bfff3ecfb0 build: don't install NetworkManager.pc when libnm-glib is disabled 2018-01-16 12:15:51 +01:00
Thomas Haller
07d8431ae5 platform: merge branch 'th/wifi-cleanup'
https://github.com/NetworkManager/NetworkManager/pull/58
2018-01-15 20:29:36 +01:00
Thomas Haller
a21a5558b1 platform: move genl functions to nm-netlink.c
So they can be reused outside of wifi, like for implementing
wireguard support.
2018-01-15 20:29:26 +01:00
Thomas Haller
d702581812 platform: move netlink functions to nm-netlink.h 2018-01-15 20:29:26 +01:00
Thomas Haller
9562d88633 platform: add nm-netlink.h for netlink related helper functions
Especially useful, because we don't link against libnl-genl-3.so
but re-implement generic netlink support. Such code should go there
so it can be used by various components.
2018-01-15 20:29:26 +01:00
Thomas Haller
d2292cc649 wifi: remove configure checks for suitable WEXT header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/wireless.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
cd6116e58f wifi: remove configure checks for suitable linux/nl80211.h header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/nl80211.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
a3f77b259c wifi: always build nl80211 CRIT_PROTOCOL support
netlink's API is stable, and strictly defined by the integer values that make
up commands and attributes. There is little reason do disable a netlink feature
based on compile time detection of the kernel headers.

Either kernel supports it, or it will fail with an appropriate response.

Also, support for NL80211_CMD_CRIT_PROTOCOL_START was merge to kernel
in 2013. Maybe, we should now just always assume support (in the kernel
headers is there). Anyway, don't do that yet, but instead avoid the
defines and use the numeric values directly.
2018-01-15 20:29:26 +01:00
Thomas Haller
feb1fc2e73 wifi: rework WifiData to use a separate struct for function pointers
Add a WifiDataClass struct, that is immutable and contains all the
function pointers that were previously embedded in WifiData directly.
They are not ever modified after creation, hence this allows to have
a "static const" allocated instance of the VTable.

Also rename wifi_data_deinit() to wifi_data_unref(). It does not only
deinitialize the instance, instead it also frees it. Hence, rename it
to "unref()".
2018-01-15 20:29:26 +01:00
Thomas Haller
3cb81ee063 wifi: cleanup includes
- always include the corresponding header file first after "nm-default.h".
- include all our other headers last.
2018-01-15 20:29:26 +01:00
Thomas Haller
3de3f59ffd platform: fix wrong cleanup function in ip_route_get()
Fixes: 33a2a7c3e3
2018-01-15 20:29:26 +01:00
Francesco Giudici
345d34b369 team: merge branch 'fg/team_sys_prio_default-rh1533810'
https://bugzilla.redhat.com/show_bug.cgi?id=1533810
2018-01-15 18:28:04 +01:00