Commit graph

20467 commits

Author SHA1 Message Date
Thomas Haller
863428ef26 clients/docs: fix generated documentation for Open vSwitch
Fixes: 9be0c3330d
(cherry picked from commit bf7b941502)
2018-06-29 09:59:51 +02:00
Lubomir Rintel
225f25e041 docs: provide soft descriptions for NM{Simple,Remote}Connection
...and order them on more logical places in the libnm manual.

(cherry picked from commit e53a7365ca)
2018-06-28 20:43:29 +02:00
Lubomir Rintel
4fa1a49542 docs: include missing documentation in libnm and D-Bus docs
Check that we don't repeat the omission in future.

(cherry picked from commit cb1172ee3d)
2018-06-28 20:43:26 +02:00
Lubomir Rintel
79fe82753d examples/qt/meson: drop dbus-glib dependency
It's not actually required.

(cherry picked from commit 22813fdc60)
2018-06-28 20:41:12 +02:00
Lubomir Rintel
b478b77558 libnm/meson: make generate_setting_docs depend on the typelib
Otherwise it would attempt to use a system-wide installed one, resulting
in sadness and misery.

(cherry picked from commit d6c08691d9)
2018-06-28 20:41:12 +02:00
Lubomir Rintel
03733911cb meson: generate-setting-docs.py environment correctly
It's ugly, because meson doesnt' seem to provide any useful facilities for
dealing with environment variables. Not my fault.

(cherry picked from commit 21840f5321)
2018-06-28 20:41:12 +02:00
Timothy Redaelli
bb9ce74a59 contrib/rpm: Use Open vSwitch instead of OpenVSwitch
The correct naming is Open vSwitch so use it instead of OpenVSwitch

[lkundrak@v3.sk: added some more cases of the same]

https://github.com/NetworkManager/NetworkManager/pull/150

Fixes: 830a5a14cb
(cherry picked from commit 9be0c3330d)
2018-06-28 20:40:13 +02:00
Thomas Haller
f550674d25 logging: merge branch 'th/logging-rh1593519'
https://github.com/NetworkManager/NetworkManager/pull/145
https://bugzilla.redhat.com/show_bug.cgi?id=1593519

(cherry picked from commit 71a26617d8)
2018-06-27 09:21:52 +02:00
Thomas Haller
dbd48f260e logging: warn about invalid logging backends and drop "debug" backend
"debug" was documentation in `man NetworkManager.conf` as a valid
logging backend. However, it was completely ignored by
nm_logging_syslog_openlog().
In fact, it makes not sense. Passing debug = TRUE to
nm_logging_syslog_openlog(), means that all messages will be
printed to stderr in addition to syslog/journal. However, when
NetworkManager is daemonizing, stderr is closed.
Whether NetworkManager is daemonizing depends entirely on command
line options --no-daemon and --debug. Hence, the logging backend "debug"
from the configuration file either conflicts or is redundant.

Also, adjust logging backend description in `man NetworkManager.conf`.

Also, log a warning about invalid/unsupported logging backend.

(cherry picked from commit 2ccf6168dc)
2018-06-27 09:21:33 +02:00
Thomas Haller
a64b424da3 logging/trivial: add code comment about logging-backend
(cherry picked from commit 504ad2aeed)
2018-06-27 09:21:33 +02:00
Thomas Haller
1b83cab13b logging: move fetching monotonic timestamp to end of nm_logging_syslog_openlog()
It just makes more sense to first fully setup logging, and then fetching
the timestamp. In practice, the effect previously was very similar.

(cherry picked from commit 2912155584)
2018-06-27 09:21:33 +02:00
Thomas Haller
64e14855f7 main: warn about invalid logging domains configuration using nm-log
Delay warning about invalid domains until we setup syslog and nm-logging.
Preferably, we don't log anything by directly printing to stdout/stderr.

(cherry picked from commit 4439b6a35d)
2018-06-27 09:21:33 +02:00
Thomas Haller
b4844435be main: accept invalid logging configuration in NetworkManager.conf gracefully
https://bugzilla.redhat.com/show_bug.cgi?id=1593519
(cherry picked from commit 11303fd2d1)
2018-06-27 09:21:33 +02:00
Thomas Haller
5be0ad48e8 main: free error variable in main() at exit
Just try to free everything that was allocated. Don't leak
error in case of failure.

(cherry picked from commit 9e20ba6646)
2018-06-27 09:21:33 +02:00
Thomas Haller
141696b4e3 libnm-glib/tests: retry nm-client tests for libnm-glib
They are known to be racy and occasionally break. Especially in
cases where the system's CPU is busy, like during parallel
`make check -j`.

It's likely a bug in libnm-glib. libnm-glib is deprecated, and the
library didn't significantly change now for several releases.
Let's not invest effort into finding bugs in the deprecated library,
bugs that are known to exist. Also, at this point, larger rework
of libnm-glib is not going to happen anymore.

Retry the test up to 5 times, trying to workaround the test failures.

(cherry picked from commit 372c0eb3ed)
2018-06-25 12:33:39 +02:00
Beniamino Galvani
4c2e7b6d4d bond: fix setting num_grat_arp option
'num_grat_arp' and 'num_unsol_na' are actually the same attribute on
kernel side, so if only 'num_grat_arp' is set in configuration, we
first write its value and then overwrite it with the 'num_unsol_na'
default value (1). Instead, just write one of the two option.

https://bugzilla.redhat.com/show_bug.cgi?id=1591734
(cherry picked from commit 42b0bef33c)
2018-06-25 10:53:42 +02:00
Thomas Haller
b32c03c879 clients: fix using hints for 802-1x secret request
https://github.com/NetworkManager/NetworkManager/pull/139

Fixes: 1a6e53808d
(cherry picked from commit 55598d8104)
2018-06-24 14:16:13 +02:00
Beniamino Galvani
f532ceb883 device: merge branch 'bg/mtu-rh1586191'
https://bugzilla.redhat.com/show_bug.cgi?id=1586191

(cherry picked from commit cbfe9a6e16)
2018-06-23 12:04:59 +02:00
Beniamino Galvani
b445c59f2e 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.

(cherry picked from commit 2f8917237f)
2018-06-23 12:03:43 +02:00
Beniamino Galvani
ccecc6db59 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.

(cherry picked from commit 9f8b0697de)
2018-06-23 12:03:40 +02:00
Beniamino Galvani
ef0b76a0ec device: introduce nm_device_get_configured_mtu_from_connection()
Deduplicate similar code from devices.

(cherry picked from commit d9df1f1d05)
2018-06-23 12:03:37 +02:00
Beniamino Galvani
52e7d6ef46 libnm-core: reject tc configurations with duplicate elements
A configuration with duplicate tc qdiscs and tfilters is not valid;
reject it in verify(). Note that nm_setting_tc_config_add_qdisc() and
nm_setting_tc_config_add_tfilter() can't add duplicate entries and so
the only way to achieve an invalid configuration is setting the
properties directly.

https://github.com/NetworkManager/NetworkManager/pull/95
(cherry picked from commit 2576e3a8e8)
2018-06-23 11:52:24 +02:00
Thomas Haller
ae393ed9ba wifi: merge branch 'balrog-kun:iwd-agent'
https://github.com/NetworkManager/NetworkManager/pull/139

(cherry picked from commit 5e8773ee63)
2018-06-22 16:46:11 +02:00
Thomas Haller
df4c62a9c2 manager: return NULL for invalid ifindex in nm_manager_get_device_by_ifindex()
Internally, the device migth have negative or zero ifindex.
When calling nm_manager_get_device_by_ifindex(), the caller
wants to find a device with a valid ifindex, hence filter
out non-positive values.

(cherry picked from commit 31245cdd62)
2018-06-22 16:46:05 +02:00
Thomas Haller
97de856036 wifi/iwd: downgrade error levels for agent-request failures
<error> level is for something really bad happening. When another party
(iwd in this case) sends a D-Bus request that we cannot meaningfully handle,
that is hardly reason to warn about. <debug> level is enough in this case.

Also, give all messages a common prefix "agent-request" so that we have
something to grep for.

(cherry picked from commit aef5110fa6)
2018-06-22 16:46:05 +02:00
Thomas Haller
759fbf08de wifi/iwd: fix leaking name-owner in agent_dbus_method_cb()
(cherry picked from commit 412a1fb46d)
2018-06-22 16:46:05 +02:00
Thomas Haller
991ae93862 wifi/iwd: don't check return value for nm_utils_random_bytes()
nm_utils_random_bytes() will always try its best to give some
random numbers. A failure only means, that the kernel interfaces
get_random() or /dev/urandom failed to provide good randomness. We
don't really need good random numbers here, so no need to handle
a failure.

(cherry picked from commit 44cd60e820)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
bf7705a4b8 settings-connection: don't expect system_secrets always present
priv->system_secrets may be updated by e.g.
nm_settings_connection_new_secrets and nm_settings_connection_update,
but if the plugin creates the object with g_object_new, then adds some
settings but never adds any secrets there's no reason to call either of
those two methods.  A call to nm_settings_connection_get_secrets should
still be able to request new secrets (and may then update
priv->system_secrets as a result).

(cherry picked from commit f11246154e)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
d1163e9499 cli: use the hints from 802.1x secrets requests if given
If the hints parameter to the agent request wasn't empty, ask
specifically for the 802-1x keys listed in the hints and skip the
guessing.  I didn't add human readable names for all of the 802-1x
settings, it could be useful to do for at least the three 802-1x
properties that add_8021x_secrets already knows about because
those may have translations.

(cherry picked from commit 1a6e53808d)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
74bff39e0d iwd: don't set REQUEST_NEW secret request flag on first connection
Allow the IWD backend to use secrets provided in the connection settings
on initial connection attempt, only require new secrets on subsequent
connections when IWD asks for them -- it only asks if fresh secrets are
required.

(cherry picked from commit 24f5cf23e5)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
1e5e143679 iwd: handle new secret request types from IWD agent
The IWD DBus interface currently
(https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/doc/agent-api.txt?id=38952813dddd776f66d2ed5e88eca9a892964c06)
knows about 3 secret types related to 802.1x authentication in addition
to the PSK secret request.  Add support for the new methods and the new
secret types in NM's implementation of the IWD secret agent.  Note that
the secret types are mapped to NMSetting8021x property keys and they are
then sent to the NM Secret Agent in the hints parameter to GetSecrets,
this will need support in the NM clients as the exact usage of the
hints parameter is specified a little ambiguously, but this seems to be
one of the permitted usages.

Rework the IWD agent interface info initialization to use NM convenience
macros.

(cherry picked from commit 74d9e04a66)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
5c747f729c 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.

(cherry picked from commit ffd96edf76)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
b733bd66af 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.

(cherry picked from commit 0876332bae)
2018-06-22 16:46:05 +02:00
Andrew Zaborowski
78b14312ce 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.

(cherry picked from commit d01ba607a6)
2018-06-22 16:46:04 +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
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
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
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
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
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
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
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
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