Commit graph

20499 commits

Author SHA1 Message Date
Lubomir Rintel 7c1f3650a1 core: add NMSetting6Lowpan 2018-06-26 16:21:55 +02:00
Lubomir Rintel 2af11440f9 platform/linux: add support for 6LoWPAN links 2018-06-26 16:21:55 +02:00
Lubomir Rintel 47c51b3f26 platform: add support for 6LoWPAN links
The 6LoWPAN devices tunnel IPv6 over IEEE 802.14.5 WPAN links.
They are software devices without any interesting properties but the
parent linke.
2018-06-26 16:21:55 +02:00
Lubomir Rintel 49844ea55f device: generate pseudo 48-bit address from the WPAN short one
If an IEEE 802.15.4 WPAN device has a short address it is to be used to
get an interface identifier.
2018-06-26 16:21:55 +02:00
Lubomir Rintel 1d396e9972 core-utils: use 64-bit WPAN address for a 6LoWPAN IID
If the hardware address is a 64-bit value it can be used directly as an
IEEE EUI-64 address when generating an interface identifier.
2018-06-26 16:21:55 +02:00
Lubomir Rintel 5da77c0e2c client: support wpan setting 2018-06-26 16:21:55 +02:00
Lubomir Rintel 8901193816 clients/meta: allow formatting 16-bit values formatted as 0x%04x
This is the preferred way to format WPAN short addresses and PAN IDs.
2018-06-26 16:21:55 +02:00
Lubomir Rintel a3baf1ca21 libnm: add support for WPAN devices 2018-06-26 16:21:55 +02:00
Lubomir Rintel 179909a4f2 devices: add NMDeviceWpan 2018-06-26 16:21:54 +02:00
Lubomir Rintel 9a92468ac2 introspection: add o.fd.NM.Device.Wpan interface 2018-06-26 16:21:54 +02:00
Lubomir Rintel 8884b2cb5e core: add NMSettingWpan 2018-06-26 16:21:54 +02:00
Lubomir Rintel ae8713471c connection: pick relevant L3 settings more flexibly
For some device types it's not going to be sufficient to tell whether
they carry "IP".

In particular, there's no way to carry legacy IP over the tiny MTU
datagrams of IEEE 802.15.4 WPAN links while an IPv6 transport exist
in form of 6LoWPAN.
2018-06-26 16:21:54 +02:00
Lubomir Rintel a7d2cad67e platform/linux: add support for WPAN links 2018-06-26 16:21:54 +02:00
Lubomir Rintel 4120ad2431 platform/wpan: add WPAN utils
Modelled after wifi-utils, sans the complexity of dispatching to anything like
WEXT.
2018-06-26 16:21:54 +02:00
Lubomir Rintel 5036406b58 platform: add support for WPAN links 2018-06-26 16:21:54 +02:00
Lubomir Rintel c630a6a2c9 platform/linux: recognize 6LoWPAN links 2018-06-26 16:21:54 +02:00
Lubomir Rintel 4e3d2f5a85 platform/linux: recognize WPAN links 2018-06-26 16:21:54 +02:00
Lubomir Rintel dbb205d8d2 platform: import nl82154.h
This is public Linux API, yet the header is not in uapi.
2018-06-26 16:21:54 +02:00
Lubomir Rintel dfa8d35e57 netlink: add signed 8-bit and 32-bit accessors 2018-06-26 16:21:54 +02:00
Lubomir Rintel 732b63ffb7 paltform: add type argument to nm_platform_link_get_by_address()
Devices of different link types can actually have the same MAC address.
We'll want to use this to find a device of a particular type by its
hardware address.
2018-06-26 16:21:54 +02:00
Lubomir Rintel 6371f399ae platform: move the management of the genl socket to linux-platform
We're fine with a single genl socket instead of opening a new one for each
WifiData instance.
2018-06-26 16:21:54 +02:00
Lubomir Rintel 123b79518c platform: attach WifiData to NMPObject
This fixes leakage of the WifiData structures.
2018-06-26 16:21:54 +02:00
Lubomir Rintel 0b4010d740 platform: don't initialize pllink when not needed 2018-06-26 16:21:54 +02:00
Lubomir Rintel 787dc484b3 platform/wifi: turn NMWifiUtils into a GObject 2018-06-26 16:21:54 +02:00
Lubomir Rintel 91c82cc465 platform/wifi: rename wifi-utils to nm-wifi-utils 2018-06-26 16:21:54 +02:00
Lubomir Rintel d18d532c15 platform/wifi: drop wifi_utils_get_ifindex()
It's not used.
2018-06-26 16:21:54 +02:00
Lubomir Rintel fc53f54512 device: don't bother passing no_firmware uselessly
It's actually confusing in cases it's not handled. Besides,
nm_device_bring_up() is just happy about NULL argument.
2018-06-26 16:21:54 +02:00
Lubomir Rintel ff10d08079 setting-serial: drop verify()
We don't need to override this if it always succeeds.
2018-06-26 16:21:54 +02:00
Lubomir Rintel 2c3a14fed3 platform/wifi: drop *_get_wowlan()
It's redundant and was probably just left in a an oversight.
*_get_wake_on_wlan() now does the same thing.
2018-06-26 16:21:54 +02:00
Thomas Haller cee8b56d3f clients: merge branch 'th/clients-tests-colored'
https://github.com/NetworkManager/NetworkManager/pull/146
2018-06-26 11:38:16 +02:00
Thomas Haller 3ec62e41de clients/tests: add tests for coloring 2018-06-26 11:32:39 +02:00
Thomas Haller 94ecdc0cb9 cli: rework check-colors to first evaluate enabled/disabled
With --color=auto, coloring is enabled based on the .enable/.disable
termcolors files.

Likewise, when we enable coloring, we parse the color palette from the
.schem termcolors files.

The termcolors files are searched by finding the best match depending
on the terminal and application name. Note, that if we find a matching
file like "nmcli@xterm.enable" we still allow loading the palette from
a less specific file like "nmcli.schem" and vice versa. That was already
done before.

Previously, the search was done by calling several layers of functions, and having
in/out arguments "color_option" and "p_palette_buffer". in/out paramters
here seems confusing to me, as they are state that gets modified and carried
along.

Instead, rework the functions to clearly separate between input
and output arguments.

Also, in the auto-case, check_colors() now first determines whether
coloring is enabled, before even starting loading the palette.
This avoids loading the palette until we are sure that we need it.
2018-06-26 11:32:39 +02:00
Thomas Haller 0a82ace5b0 cli: only modify color platte when parsing is successful in parse_color_scheme()
If the palette cannot be parsed successfully, it should not partially
be modifid.
2018-06-26 11:32:39 +02:00
Thomas Haller dbc5eefedb cli: drop unused color_option argument from check_colors_file() 2018-06-26 11:32:39 +02:00
Thomas Haller 0be07d0815 cli: avoid passing NmCli to set_color() functions
The NmCli variables is essentially a global variable of *everything*.
The set_color() function and its helpers only need a particular
part of it. Instead, of passing the entire global state to them,
only pass what they need.

It makes it clearer which parts are actually relevant. Turns out,
it only actually touches a resonable small part of the global state.
2018-06-26 11:32:39 +02:00
Thomas Haller 372c0eb3ed 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.
2018-06-25 12:31:31 +02:00
Thomas Haller e2ef7cad57 tests: add nmtstc_auto_service_cleanup macro 2018-06-25 12:13:28 +02:00
Beniamino Galvani 42b0bef33c 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
2018-06-25 10:52:02 +02:00
Thomas Haller 55598d8104 clients: fix using hints for 802-1x secret request
https://github.com/NetworkManager/NetworkManager/pull/139

Fixes: 1a6e53808d
2018-06-24 14:15:42 +02:00
Beniamino Galvani 2576e3a8e8 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
2018-06-23 11:47:40 +02:00
Thomas Haller 5e8773ee63 wifi: merge branch 'balrog-kun:iwd-agent'
https://github.com/NetworkManager/NetworkManager/pull/139
2018-06-22 16:39:26 +02:00
Thomas Haller 31245cdd62 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.
2018-06-22 16:39:01 +02:00
Thomas Haller aef5110fa6 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.
2018-06-22 16:39:01 +02:00
Thomas Haller 412a1fb46d wifi/iwd: fix leaking name-owner in agent_dbus_method_cb() 2018-06-22 16:39:01 +02:00
Thomas Haller 44cd60e820 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.
2018-06-22 16:39:01 +02:00
Andrew Zaborowski f11246154e 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).
2018-06-22 16:39:01 +02:00
Andrew Zaborowski 1a6e53808d 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.
2018-06-22 16:39:01 +02:00
Andrew Zaborowski 24f5cf23e5 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.
2018-06-22 16:39:01 +02:00
Andrew Zaborowski 74d9e04a66 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.
2018-06-22 16:39:01 +02:00
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