Commit graph

20450 commits

Author SHA1 Message Date
Andrew Zaborowski
ffd96edf76 iwd: save secrets request invocation in request user_data
To improve the code logic and reduce space for bugs, don't save the
dbus invocation object as priv->secrets_request, instead move it to
the nm_act_request_get_secrets()'s user_data as we only need the
invocation object for exactly the life time of the request.  See
https://github.com/NetworkManager/NetworkManager/pull/139 for
discussion.
2018-06-22 16:39:01 +02:00
Andrew Zaborowski
0876332bae iwd: in prepare stage check that matching AP exists
Check the return value of nm_wifi_aps_find_first_compatible in
act_stage1_prepare.  Also a small formatting fix.
2018-06-22 16:39:01 +02:00
Andrew Zaborowski
d01ba607a6 iwd: handle empty wireless mode as Infrastructure
Blank mode property in the wireless settings is documented in
libnm-core/nm-setting-wireless.c to mean infrastructure mode.
2018-06-22 16:39:01 +02:00
Beniamino Galvani
a2b85d5c6e manager: fix typo in 'PrimaryConnectionType' D-Bus property name
Fixes: 297d4985ab
2018-06-22 15:53:46 +02:00
Thomas Haller
ae21723d2a shared: use nm_hash_update() instead of c_siphash_append()
In our own code, there are very few places where we should
call c_siphash_append() directly. This is not one of them.
2018-06-22 14:19:49 +02:00
Thomas Haller
41a784d7f1 wifi: merge branch 'wowlan-settings' (restore part)
https://github.com/NetworkManager/NetworkManager/pull/124
2018-06-22 14:05:54 +02:00
Thomas Haller
a3289400d3 wifi: ensure wake-on-wlan restore only acts once
- in wake_on_wlan_restore(), if we decide that there is something
  to restore, also clear priv->wowlan_restore by setting it to
  IGNORE. That way, we are sure to only try resetting the value
  once after setting it.

- from nm_platform_wifi_get_wake_on_wlan(), return IGNORE if
  the value cannot be read. If we could not read the value
  we should not restore NONE, but don't restore.
2018-06-22 14:03:48 +02:00
Alfonso Sánchez-Beato
c6e40215ef devices: restore past WoWLAN when disconnecting wifi
Restore previous WoWLAN settings on disconnection in case we had
configured it when connecting.
2018-06-22 13:54:37 +02:00
Alfonso Sánchez-Beato
ac13027934 platform: add methods to retrieve current WoWLAN state 2018-06-22 13:54:37 +02:00
Francesco Giudici
20a8bc9e34 cli: list the 'print' command in the welcome message of the editor
https://bugzilla.redhat.com/show_bug.cgi?id=1588995
2018-06-21 16:56:50 +02:00
Thomas Haller
9bc6ca96f6 libnm: fix leaking filename in NMRemoteConnection
Fixes: bd6fe17815
2018-06-21 16:06:41 +02:00
Thomas Haller
3b1b6427d1 clients/tests: add more tests showing nmcli output
Of special interest here is

  $ nmcli --mode tabular -f all dev show eth0

to look how multiple available connections are printed.
2018-06-21 13:43:16 +02:00
Beniamino Galvani
cbfe9a6e16 device: merge branch 'bg/mtu-rh1586191'
https://bugzilla.redhat.com/show_bug.cgi?id=1586191
2018-06-20 19:05:34 +02:00
Beniamino Galvani
2f8917237f device: rework mtu priority handling
If commit_mtu() is called multiple times and dev->get_configured_mtu()
returns @is_user_config=FALSE, only the first call changes the
MTU. So, for example, when the parent MTU of a VLAN changes, we apply
the new MTU only the first time.

Rework the handling of MTU in NMDevice, and store the source of the
configured MTU. When commit_mtu() is called again, we ask the subclass
a MTU to configure and apply it only if the source has higher
priority, or when the parent MTU changed.
2018-06-20 18:50:44 +02:00
Beniamino Galvani
9f8b0697de device: introduce mtu source
Instead of returning a boolean @is_user_config value from
get_configured_mtu(), return an mtu-source enum with possible values
NONE,CONNECTION. This enum will be expanded later; for now there is no
change in behavior.
2018-06-20 18:49:56 +02:00
Beniamino Galvani
d9df1f1d05 device: introduce nm_device_get_configured_mtu_from_connection()
Deduplicate similar code from devices.
2018-06-20 18:30:56 +02:00
Thomas Haller
94200b03fe device: require that device-factories support at least one link-type or setting-type
If a device-factory wouldn't support any link-type or setting-type,
we would not take an additional reference to the @factory instance
(because, the factory is not added to one of the static hash tables).

As such, we would invoke the callback with a factory instance, which
is about to be destroyed immediately afterwards. That would be unusual
for device-plugins, because usually a device-plugin is never destroyed
and essentially leaked at exit.

Just don't get into that situation. All device plugins are internal API,
and they are known to support at least something. Assert for that.
2018-06-20 16:36:26 +02:00
Thomas Haller
4c43d7cad3 device: fix leaking internal device factories
Actually, we anyway leak them, because they are added to static hash tables
which are never released. Anyway, get the ref-count right.
2018-06-20 16:31:18 +02:00
Thomas Haller
dff157b867 device: suppress info logging about internal device plugins
Internal device plugins are compiled-in. In fact, none of the
internal device plugins can currently be disabled via compile
time options. The user would have to patch the sources to
not include a particular device plugin.

Hence, the available device plugins depends exclusively on the
build itself. That is not worth <info> level logging. Especially,
as it was quite verbose, logging 13 lines.
2018-06-20 16:17:03 +02:00
Thomas Haller
3798f98829 device: don't attach unused device-plugin-path to device factory 2018-06-20 16:11:49 +02:00
Thomas Haller
fb63d8d706 platform/tests: fix race in tests
Otherwise, we easily get a failure

    test:ERROR:src/platform/tests/test-cleanup.c:78:test_cleanup_internal: assertion failed (addresses6->len == 2): (1 == 2)

Avoid that by waiting for kernel to add the link-local
address.
2018-06-20 14:46:07 +02:00
Thomas Haller
07a34f2404 platform/tests: fix generating IPv6 link local address in fake-platform 2018-06-20 14:46:07 +02:00
Thomas Haller
86dc1f1394 tests: expose current state in local context of NMTST_WAIT()
Inside the loop-handler, it can be interesting to know the current iteration,
and how much time is left.
2018-06-20 14:45:27 +02:00
Francesco Giudici
1dba7eda7a merge: branch 'fg/duid_enforce_as_bool'
https://github.com/NetworkManager/NetworkManager/pull/142
2018-06-20 10:46:20 +02:00
Francesco Giudici
08116409f3 dhcp: look for DUID in both private and global DHCP client lease files
Option to check just in NM private dhcp client specific lease files has
been dropped: either get DUID from specific DHCP plugin or just use the
provided one.

This reverts commit f054c3fcaa.
2018-06-20 10:43:51 +02:00
Francesco Giudici
0a662a3620 dhcp: drop NMDhcpDuidEnforce type
A gboolean is enough: make code easier.
2018-06-20 10:43:51 +02:00
Piotr Drąg
f4bef9a12e po: update Polish (pl) translation (bgo #796610)
https://bugzilla.gnome.org/show_bug.cgi?id=796610
2018-06-19 16:55:39 +02:00
Piotr Drąg
eb54fc0bef po: fix broken strings in Japanese translation (bgo#796611)
https://bugzilla.gnome.org/show_bug.cgi?id=796611
2018-06-19 16:53:20 +02:00
Thomas Haller
f468602d50 shared: support nm_g_slice_free_fcn() for arguments with sizeof() of 10 bytes
On m68k architecture, the struct

    typedef struct {
        gint64 timestamp_ms;
        bool dirty;
    } IP6RoutesTemporaryNotAvailableData;

ends up being of a previously unhandled size. Causing a compile time
assertion to fail.

Support argument sizes of 10 bytes for nm_g_slice_free_fcn().
2018-06-19 14:44:51 +02:00
Lubomir Rintel
e27b15c00d all: remove CLOCK_BOOTTIME defintions
It's useless and redundant noise.

The original motivation seems to have been compatibility with ancient
versions uClibc (2011), but given CLOCK_BOOTTIME definition is shipped with
kernel headers, the libc version shall not matter anyway.

Even if it was the case, uClibc has shipped the definition for over
7 years now and been superseded by uClibc-ng that always had the
definition.
2018-06-18 17:21:32 +02:00
Lubomir Rintel
e1db543b5b contrib: add a serial modem emulator
Useful for quickly testing the ModemManager integration.
2018-06-18 16:05:29 +02:00
Thomas Haller
6dec8ea9f3 dispatcher/tests: fix test after adding NM_DISPATCHER_ACTION
Also, fix existing tests regarding connectivity action.

Fixes: ce9619047c
2018-06-18 14:43:30 +02:00
Thomas Haller
ce9619047c dispatcher: add NM_DISPATCHER_ACTION environment variable
Previously, the action was only passed as the first command line
argument to the dispatcher scripts. Now, also set it via the
"$NM_DISPATCHER_ACTION" environment variable.

The main purpose is to have a particular, nm-dispatcher specific
variable that is always set inside the dispatcher scripts.
For example, imagine you have a script that can be either called by
dispatcher or some other means (manually, or spawned via
/etc/NetworkManager/dispatcher.d/11-dhclient).  Then it might make
sense to differenciate from inside the script whether you are called
by nm-dispatcher. But previously, there was no specific environment
variable that was always set inside the dispatcher event. For example,
with the "hostname" action there are no other environment variables.

Now (with version 1.12), you can check for `test -n "$NM_DISPATCHER_ACTION"`.
2018-06-18 14:18:08 +02:00
Thomas Haller
4822bff7aa release: update NEWS for 1.10.10 release
1.10.10 was released still before 1.12.0. Update the
NEWS to reflect that.

(cherry picked from commit f8dfc436b1)
2018-06-18 14:16:44 +02:00
Thomas Haller
3a58c956c5 travis: we don't need de_DE locale for clients tests
clients/tests only uses Polish locale for testing localized output.
No need to generate the Germane locale as well.
2018-06-18 11:29:53 +02:00
Thomas Haller
4e18ef49bf tests: don't exit test-networkmanager-service.py after 20 seconds
Tests might just take longer than 20 seconds.

Also, we already watch stdin to determine whether the service
should exit.
2018-06-18 11:24:21 +02:00
Thomas Haller
56a0488bba tests: improve NetworkManager stub service for Wi-Fi scanning
Now that nmcli initiates a scan before displaying Wi-Fi networks,
the stub service must properly support that as well.

For the moment, the stub service chooses "now" as LastScan timestamp.
This causes nmcli not to trigger a new scan, because nmcli gives
unstable output if multiple nmcli processes in parallel race to
trigger a Wi-Fi scan. That should be fixed.
2018-06-18 10:56:50 +02:00
Thomas Haller
7e118c0091 tests: fix race in setting signal strength for Wi-Fi AP in NM stub
This opens the tests up to races. If we want to change the strength, we
need to do it in a controlled, race-free manner. This is especially the
case, because clients/tests run a large number of nmcli instances in
parallel, and it's thus racy which signal the nmcli processes will
see.

This also fixes a bug at

    self._dbus_property_set(IFACE_WIFI_AP, PRP_WIFI_AP_STRENGTH, strength)

@strength must be a D-Bus type, so that python-dbus knows the correct
type for serialization.
2018-06-18 10:55:40 +02:00
Thomas Haller
fb9edd5edd release: bump version to 1.13.0 (development) 2018-06-15 17:16:18 +02:00
Thomas Haller
e0d7e29334 release: bump version to 1.11.90 (1.12-rc1) 2018-06-15 17:16:18 +02:00
Thomas Haller
cc3d577acd release: update NEWS 2018-06-15 17:16:18 +02:00
Thomas Haller
dd91d0d79c build: fix make distcheck by building --with-libnm-glib
During make-distcheck we pre-generate documentation. For that
we need to build with libnm-glib enabled.

Fixes: df58895fb3
2018-06-15 17:16:18 +02:00
Thomas Haller
9c3e52b532 all: merge branch 'lr/msec-timestamp'
https://github.com/NetworkManager/NetworkManager/pull/140
2018-06-15 16:38:03 +02:00
Lubomir Rintel
4f557db063 clients/tests: utilize nm_utils_get_timestamp_msec() 2018-06-15 16:23:30 +02:00
Lubomir Rintel
1b6127d1bc examples/python: utilize nm_utils_get_timestamp_msec() 2018-06-15 16:23:30 +02:00
Lubomir Rintel
cfa3a02b91 tools/test-service: utilize nm_utils_get_timestamp_msec()
This is probably better than a hardcoded timestamp.
2018-06-15 16:23:30 +02:00
Lubomir Rintel
5269aba7b4 cli: utilize nm_utils_get_timestamp_msec() 2018-06-15 16:23:30 +02:00
Lubomir Rintel
0132da1ddb libnm: add nm_utils_get_timestamp_msec() 2018-06-15 16:23:30 +02:00
Lubomir Rintel
07fd0502f6 wifi: expose LastScan as milliseconds not seconds
This doesn't wrap around in 68 years of uptime and is consistent with
o.fd.NM.Checkpoint.Created.
2018-06-15 16:23:30 +02:00
Lubomir Rintel
1c0aa397b3 libnm: correctly demarshall (u)int64 values 2018-06-15 16:23:30 +02:00