Commit Graph

20770 Commits

Author SHA1 Message Date
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
64e4616a3d manager: fix typo in 'PrimaryConnectionType' D-Bus property name
Fixes: 297d4985ab
(cherry picked from commit a2b85d5c6e)
2018-06-22 16:00:58 +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
da81f346cd libnm: fix leaking filename in NMRemoteConnection
Fixes: bd6fe17815
(cherry picked from commit 9bc6ca96f6)
2018-06-21 16:09:14 +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
1388569fce 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.

(cherry picked from commit 94200b03fe)
2018-06-20 16:42:15 +02:00
Thomas Haller
aa27007ff0 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.

(cherry picked from commit 4c43d7cad3)
2018-06-20 16:42:14 +02:00
Thomas Haller
2b2e9bba74 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.

(cherry picked from commit dff157b867)
2018-06-20 16:42:14 +02:00
Thomas Haller
7713a71910 device: don't attach unused device-plugin-path to device factory
(cherry picked from commit 3798f98829)
2018-06-20 16:42:13 +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
b6ff26fb2f 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.

(cherry picked from commit fb63d8d706)
2018-06-20 14:53:41 +02:00
Thomas Haller
4ca064043a platform/tests: fix generating IPv6 link local address in fake-platform
(cherry picked from commit 07a34f2404)
2018-06-20 14:53:40 +02:00
Thomas Haller
945f51d623 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.

(cherry picked from commit 86dc1f1394)
2018-06-20 14:53:39 +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
844ef9fbdb merge: branch 'fg/duid_enforce_as_bool'
https://github.com/NetworkManager/NetworkManager/pull/142
(cherry picked from commit 1dba7eda7a)
2018-06-20 11:39:53 +02:00
Francesco Giudici
c7d0363bee 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.

(cherry picked from commit 08116409f3)
2018-06-20 11:39:27 +02:00
Francesco Giudici
4ed98ba308 dhcp: drop NMDhcpDuidEnforce type
A gboolean is enough: make code easier.

(cherry picked from commit 0a662a3620)
2018-06-20 11:39: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
d9abab722a po: update Polish (pl) translation (bgo #796610)
https://bugzilla.gnome.org/show_bug.cgi?id=796610
(cherry picked from commit f4bef9a12e)
2018-06-19 17:00:07 +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
2b39e2d973 po: fix broken strings in Japanese translation (bgo#796611)
https://bugzilla.gnome.org/show_bug.cgi?id=796611
(cherry picked from commit eb54fc0bef)
2018-06-19 16:54:19 +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
b72db2c82a 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().

(cherry picked from commit f468602d50)
2018-06-19 14:45:47 +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
ccf1bc7a06 dispatcher/tests: fix test after adding NM_DISPATCHER_ACTION
Also, fix existing tests regarding connectivity action.

Fixes: ce9619047c
(cherry picked from commit 6dec8ea9f3)
2018-06-18 15:43:38 +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
2800232bbf 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"`.

(cherry picked from commit ce9619047c)
2018-06-18 14:19:16 +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
f8dfc436b1 release: update NEWS for 1.10.10 release
1.10.10 was released still before 1.12.0. Update the
NEWS to reflect that.
2018-06-18 13:38:38 +02:00