Commit Graph

21088 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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